All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.keyvault.kotlin.ManagedHardwareSecurityModuleRoleDefinitionArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.keyvault.kotlin

import com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleRoleDefinitionArgs.builder
import com.pulumi.azure.keyvault.kotlin.inputs.ManagedHardwareSecurityModuleRoleDefinitionPermissionArgs
import com.pulumi.azure.keyvault.kotlin.inputs.ManagedHardwareSecurityModuleRoleDefinitionPermissionArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * 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
 * ```
 * @property description Specifies a text description about this KeyVault Role Definition.
 * @property managedHsmId
 * @property name The name which should be used for this KeyVault Role Definition. Changing this forces a new KeyVault Role Definition to be created.
 * @property permissions One or more `permission` blocks as defined below.
 * @property roleName Specify a name for this KeyVault Role Definition.
 * @property vaultBaseUrl The base URL of the managed hardware security module resource. Changing this forces a new KeyVault Role Definition to be created.
 */
public data class ManagedHardwareSecurityModuleRoleDefinitionArgs(
    public val description: Output? = null,
    public val managedHsmId: Output? = null,
    public val name: Output? = null,
    public val permissions: Output>? =
        null,
    public val roleName: Output? = null,
    public val vaultBaseUrl: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleRoleDefinitionArgs =
        com.pulumi.azure.keyvault.ManagedHardwareSecurityModuleRoleDefinitionArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .managedHsmId(managedHsmId?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .permissions(
                permissions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .roleName(roleName?.applyValue({ args0 -> args0 }))
            .vaultBaseUrl(vaultBaseUrl?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ManagedHardwareSecurityModuleRoleDefinitionArgs].
 */
@PulumiTagMarker
public class ManagedHardwareSecurityModuleRoleDefinitionArgsBuilder internal constructor() {
    private var description: Output? = null

    private var managedHsmId: Output? = null

    private var name: Output? = null

    private var permissions: Output>? =
        null

    private var roleName: Output? = null

    private var vaultBaseUrl: Output? = null

    /**
     * @param value Specifies a text description about this KeyVault Role Definition.
     */
    @JvmName("ytqtjthgacebwbmr")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value
     */
    @JvmName("mveffnyjqyvweobv")
    public suspend fun managedHsmId(`value`: Output) {
        this.managedHsmId = value
    }

    /**
     * @param value The name which should be used for this KeyVault Role Definition. Changing this forces a new KeyVault Role Definition to be created.
     */
    @JvmName("egrvyqclwniocsdc")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value One or more `permission` blocks as defined below.
     */
    @JvmName("rmysmlorxlfmpnet")
    public suspend
    fun permissions(`value`: Output>) {
        this.permissions = value
    }

    @JvmName("wnhwvnnshyoaxrfj")
    public suspend fun permissions(
        vararg
        values: Output,
    ) {
        this.permissions = Output.all(values.asList())
    }

    /**
     * @param values One or more `permission` blocks as defined below.
     */
    @JvmName("lrmbyluxlavtkxbo")
    public suspend
    fun permissions(values: List>) {
        this.permissions = Output.all(values)
    }

    /**
     * @param value Specify a name for this KeyVault Role Definition.
     */
    @JvmName("ueujgbqdffyiptqb")
    public suspend fun roleName(`value`: Output) {
        this.roleName = value
    }

    /**
     * @param value The base URL of the managed hardware security module resource. Changing this forces a new KeyVault Role Definition to be created.
     */
    @JvmName("wpuhffjbulouoyli")
    public suspend fun vaultBaseUrl(`value`: Output) {
        this.vaultBaseUrl = value
    }

    /**
     * @param value Specifies a text description about this KeyVault Role Definition.
     */
    @JvmName("klytostxwwtgdqyc")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value
     */
    @JvmName("andnrktscrimtelx")
    public suspend fun managedHsmId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.managedHsmId = mapped
    }

    /**
     * @param value The name which should be used for this KeyVault Role Definition. Changing this forces a new KeyVault Role Definition to be created.
     */
    @JvmName("tbiunomvqnfuvxhq")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value One or more `permission` blocks as defined below.
     */
    @JvmName("kfxdvgmjcwymqeun")
    public suspend
    fun permissions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.permissions = mapped
    }

    /**
     * @param argument One or more `permission` blocks as defined below.
     */
    @JvmName("xgafjbpkpsnlbaro")
    public suspend
    fun permissions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ManagedHardwareSecurityModuleRoleDefinitionPermissionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.permissions = mapped
    }

    /**
     * @param argument One or more `permission` blocks as defined below.
     */
    @JvmName("iqugdxbvhejbhprk")
    public suspend fun permissions(
        vararg
        argument: suspend ManagedHardwareSecurityModuleRoleDefinitionPermissionArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            ManagedHardwareSecurityModuleRoleDefinitionPermissionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.permissions = mapped
    }

    /**
     * @param argument One or more `permission` blocks as defined below.
     */
    @JvmName("ebbarnpshhqswawj")
    public suspend
    fun permissions(argument: suspend ManagedHardwareSecurityModuleRoleDefinitionPermissionArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                ManagedHardwareSecurityModuleRoleDefinitionPermissionArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.permissions = mapped
    }

    /**
     * @param values One or more `permission` blocks as defined below.
     */
    @JvmName("ymntpjiuhuhrcyyy")
    public suspend fun permissions(
        vararg
        values: ManagedHardwareSecurityModuleRoleDefinitionPermissionArgs,
    ) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.permissions = mapped
    }

    /**
     * @param value Specify a name for this KeyVault Role Definition.
     */
    @JvmName("ibotqfounkcuswvo")
    public suspend fun roleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.roleName = mapped
    }

    /**
     * @param value The base URL of the managed hardware security module resource. Changing this forces a new KeyVault Role Definition to be created.
     */
    @JvmName("scepxgbnpmfwjevp")
    public suspend fun vaultBaseUrl(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vaultBaseUrl = mapped
    }

    internal fun build(): ManagedHardwareSecurityModuleRoleDefinitionArgs =
        ManagedHardwareSecurityModuleRoleDefinitionArgs(
            description = description,
            managedHsmId = managedHsmId,
            name = name,
            permissions = permissions,
            roleName = roleName,
            vaultBaseUrl = vaultBaseUrl,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy