com.pulumi.azure.keyvault.kotlin.ManagedHardwareSecurityModuleRoleDefinition.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.keyvault.kotlin
import com.pulumi.azure.keyvault.kotlin.outputs.ManagedHardwareSecurityModuleRoleDefinitionPermission
import com.pulumi.azure.keyvault.kotlin.outputs.ManagedHardwareSecurityModuleRoleDefinitionPermission.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [ManagedHardwareSecurityModuleRoleDefinition].
*/
@PulumiTagMarker
public class ManagedHardwareSecurityModuleRoleDefinitionResourceBuilder internal constructor() {
public var name: String? = null
public var args: ManagedHardwareSecurityModuleRoleDefinitionArgs =
ManagedHardwareSecurityModuleRoleDefinitionArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend
fun args(block: suspend ManagedHardwareSecurityModuleRoleDefinitionArgsBuilder.() -> Unit) {
val builder = ManagedHardwareSecurityModuleRoleDefinitionArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): ManagedHardwareSecurityModuleRoleDefinition {
val builtJavaResource =
com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleRoleDefinition(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ManagedHardwareSecurityModuleRoleDefinition(builtJavaResource)
}
}
/**
* Manages a KeyVault Managed Hardware Security Module Role Definition. This resource works together with Managed hardware security module resource.
* ## Example Usage
*
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.keyvault.ManagedHardwareSecurityModule;
* import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleArgs;
* import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleRoleDefinition;
* import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleRoleDefinitionArgs;
* import com.pulumi.azure.keyvault.inputs.ManagedHardwareSecurityModuleRoleDefinitionPermissionArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new ManagedHardwareSecurityModule("example", ManagedHardwareSecurityModuleArgs.builder()
* .name("example")
* .resourceGroupName(exampleAzurermResourceGroup.name())
* .location(exampleAzurermResourceGroup.location())
* .skuName("Standard_B1")
* .tenantId(current.tenantId())
* .adminObjectIds(current.objectId())
* .purgeProtectionEnabled(false)
* .activeConfig(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
* .build());
* var exampleManagedHardwareSecurityModuleRoleDefinition = new ManagedHardwareSecurityModuleRoleDefinition("exampleManagedHardwareSecurityModuleRoleDefinition", ManagedHardwareSecurityModuleRoleDefinitionArgs.builder()
* .name("7d206142-bf01-11ed-80bc-00155d61ee9e")
* .vaultBaseUrl(example.hsmUri())
* .description("desc foo")
* .permissions(ManagedHardwareSecurityModuleRoleDefinitionPermissionArgs.builder()
* .dataActions("Microsoft.KeyVault/managedHsm/keys/read/action")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:keyvault:ManagedHardwareSecurityModule
* properties:
* name: example
* resourceGroupName: ${exampleAzurermResourceGroup.name}
* location: ${exampleAzurermResourceGroup.location}
* skuName: Standard_B1
* tenantId: ${current.tenantId}
* adminObjectIds:
* - ${current.objectId}
* purgeProtectionEnabled: false
* activeConfig:
* - securityDomainCertificate:
* - ${cert[0].id}
* - ${cert[1].id}
* - ${cert[2].id}
* securityDomainQuorum: 2
* exampleManagedHardwareSecurityModuleRoleDefinition:
* type: azure:keyvault:ManagedHardwareSecurityModuleRoleDefinition
* name: example
* properties:
* name: 7d206142-bf01-11ed-80bc-00155d61ee9e
* vaultBaseUrl: ${example.hsmUri}
* description: desc foo
* permissions:
* - dataActions:
* - Microsoft.KeyVault/managedHsm/keys/read/action
* ```
*
* ## Import
* KeyVaults can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:keyvault/managedHardwareSecurityModuleRoleDefinition:ManagedHardwareSecurityModuleRoleDefinition example https://0000.managedhsm.azure.net///RoleDefinition/00000000-0000-0000-0000-000000000000
* ```
*/
public class ManagedHardwareSecurityModuleRoleDefinition internal constructor(
override val javaResource: com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleRoleDefinition,
) : KotlinCustomResource(javaResource, ManagedHardwareSecurityModuleRoleDefinitionMapper) {
/**
* Specifies a text description about this KeyVault Role Definition.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
public val managedHsmId: Output
get() = javaResource.managedHsmId().applyValue({ args0 -> args0 })
/**
* The name which should be used for this KeyVault Role Definition. Changing this forces a new KeyVault Role Definition to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* One or more `permission` blocks as defined below.
*/
public val permissions: Output>?
get() = javaResource.permissions().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
/**
* The ID of the role definition resource without Key Vault base URL.
*/
public val resourceManagerId: Output
get() = javaResource.resourceManagerId().applyValue({ args0 -> args0 })
/**
* Specify a name for this KeyVault Role Definition.
*/
public val roleName: Output?
get() = javaResource.roleName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The type of the role definition. Possible values are `AKVBuiltInRole` and `CustomRole`.
*/
public val roleType: Output
get() = javaResource.roleType().applyValue({ args0 -> args0 })
/**
* The base URL of the managed hardware security module resource. Changing this forces a new KeyVault Role Definition to be created.
*/
public val vaultBaseUrl: Output
get() = javaResource.vaultBaseUrl().applyValue({ args0 -> args0 })
}
public object ManagedHardwareSecurityModuleRoleDefinitionMapper :
ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleRoleDefinition::class == javaResource::class
override fun map(javaResource: Resource): ManagedHardwareSecurityModuleRoleDefinition =
ManagedHardwareSecurityModuleRoleDefinition(
javaResource as
com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleRoleDefinition,
)
}
/**
* @see [ManagedHardwareSecurityModuleRoleDefinition].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ManagedHardwareSecurityModuleRoleDefinition].
*/
public suspend fun managedHardwareSecurityModuleRoleDefinition(
name: String,
block: suspend ManagedHardwareSecurityModuleRoleDefinitionResourceBuilder.() -> Unit,
):
ManagedHardwareSecurityModuleRoleDefinition {
val builder = ManagedHardwareSecurityModuleRoleDefinitionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ManagedHardwareSecurityModuleRoleDefinition].
* @param name The _unique_ name of the resulting resource.
*/
public fun managedHardwareSecurityModuleRoleDefinition(name: String):
ManagedHardwareSecurityModuleRoleDefinition {
val builder = ManagedHardwareSecurityModuleRoleDefinitionResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy