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

com.pulumi.azurenative.compute.kotlin.DiskEncryptionSetArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.compute.kotlin

import com.pulumi.azurenative.compute.DiskEncryptionSetArgs.builder
import com.pulumi.azurenative.compute.kotlin.enums.DiskEncryptionSetType
import com.pulumi.azurenative.compute.kotlin.inputs.EncryptionSetIdentityArgs
import com.pulumi.azurenative.compute.kotlin.inputs.EncryptionSetIdentityArgsBuilder
import com.pulumi.azurenative.compute.kotlin.inputs.KeyForDiskEncryptionSetArgs
import com.pulumi.azurenative.compute.kotlin.inputs.KeyForDiskEncryptionSetArgsBuilder
import com.pulumi.core.Either
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.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * disk encryption set resource.
 * Azure REST API version: 2022-07-02. Prior API version in Azure Native 1.x: 2020-12-01.
 * Other available API versions: 2020-06-30, 2023-01-02, 2023-04-02, 2023-10-02, 2024-03-02.
 * ## Example Usage
 * ### Create a disk encryption set with key vault from a different subscription.
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var diskEncryptionSet = new AzureNative.Compute.DiskEncryptionSet("diskEncryptionSet", new()
 *     {
 *         ActiveKey = new AzureNative.Compute.Inputs.KeyForDiskEncryptionSetArgs
 *         {
 *             KeyUrl = "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}",
 *         },
 *         DiskEncryptionSetName = "myDiskEncryptionSet",
 *         EncryptionType = AzureNative.Compute.DiskEncryptionSetType.EncryptionAtRestWithCustomerKey,
 *         Identity = new AzureNative.Compute.Inputs.EncryptionSetIdentityArgs
 *         {
 *             Type = AzureNative.Compute.DiskEncryptionSetIdentityType.SystemAssigned,
 *         },
 *         Location = "West US",
 *         ResourceGroupName = "myResourceGroup",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	compute "github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := compute.NewDiskEncryptionSet(ctx, "diskEncryptionSet", &compute.DiskEncryptionSetArgs{
 * 			ActiveKey: &compute.KeyForDiskEncryptionSetArgs{
 * 				KeyUrl: pulumi.String("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}"),
 * 			},
 * 			DiskEncryptionSetName: pulumi.String("myDiskEncryptionSet"),
 * 			EncryptionType:        pulumi.String(compute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey),
 * 			Identity: &compute.EncryptionSetIdentityArgs{
 * 				Type: pulumi.String(compute.DiskEncryptionSetIdentityTypeSystemAssigned),
 * 			},
 * 			Location:          pulumi.String("West US"),
 * 			ResourceGroupName: pulumi.String("myResourceGroup"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.compute.DiskEncryptionSet;
 * import com.pulumi.azurenative.compute.DiskEncryptionSetArgs;
 * import com.pulumi.azurenative.compute.inputs.KeyForDiskEncryptionSetArgs;
 * import com.pulumi.azurenative.compute.inputs.EncryptionSetIdentityArgs;
 * 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 diskEncryptionSet = new DiskEncryptionSet("diskEncryptionSet", DiskEncryptionSetArgs.builder()
 *             .activeKey(KeyForDiskEncryptionSetArgs.builder()
 *                 .keyUrl("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}")
 *                 .build())
 *             .diskEncryptionSetName("myDiskEncryptionSet")
 *             .encryptionType("EncryptionAtRestWithCustomerKey")
 *             .identity(EncryptionSetIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .location("West US")
 *             .resourceGroupName("myResourceGroup")
 *             .build());
 *     }
 * }
 * ```
 * ### Create a disk encryption set.
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var diskEncryptionSet = new AzureNative.Compute.DiskEncryptionSet("diskEncryptionSet", new()
 *     {
 *         ActiveKey = new AzureNative.Compute.Inputs.KeyForDiskEncryptionSetArgs
 *         {
 *             KeyUrl = "https://myvmvault.vault-int.azure-int.net/keys/{key}",
 *             SourceVault = new AzureNative.Compute.Inputs.SourceVaultArgs
 *             {
 *                 Id = "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault",
 *             },
 *         },
 *         DiskEncryptionSetName = "myDiskEncryptionSet",
 *         EncryptionType = AzureNative.Compute.DiskEncryptionSetType.EncryptionAtRestWithCustomerKey,
 *         Identity = new AzureNative.Compute.Inputs.EncryptionSetIdentityArgs
 *         {
 *             Type = AzureNative.Compute.DiskEncryptionSetIdentityType.SystemAssigned,
 *         },
 *         Location = "West US",
 *         ResourceGroupName = "myResourceGroup",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	compute "github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := compute.NewDiskEncryptionSet(ctx, "diskEncryptionSet", &compute.DiskEncryptionSetArgs{
 * 			ActiveKey: &compute.KeyForDiskEncryptionSetArgs{
 * 				KeyUrl: pulumi.String("https://myvmvault.vault-int.azure-int.net/keys/{key}"),
 * 				SourceVault: &compute.SourceVaultArgs{
 * 					Id: pulumi.String("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"),
 * 				},
 * 			},
 * 			DiskEncryptionSetName: pulumi.String("myDiskEncryptionSet"),
 * 			EncryptionType:        pulumi.String(compute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey),
 * 			Identity: &compute.EncryptionSetIdentityArgs{
 * 				Type: pulumi.String(compute.DiskEncryptionSetIdentityTypeSystemAssigned),
 * 			},
 * 			Location:          pulumi.String("West US"),
 * 			ResourceGroupName: pulumi.String("myResourceGroup"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.compute.DiskEncryptionSet;
 * import com.pulumi.azurenative.compute.DiskEncryptionSetArgs;
 * import com.pulumi.azurenative.compute.inputs.KeyForDiskEncryptionSetArgs;
 * import com.pulumi.azurenative.compute.inputs.SourceVaultArgs;
 * import com.pulumi.azurenative.compute.inputs.EncryptionSetIdentityArgs;
 * 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 diskEncryptionSet = new DiskEncryptionSet("diskEncryptionSet", DiskEncryptionSetArgs.builder()
 *             .activeKey(KeyForDiskEncryptionSetArgs.builder()
 *                 .keyUrl("https://myvmvault.vault-int.azure-int.net/keys/{key}")
 *                 .sourceVault(SourceVaultArgs.builder()
 *                     .id("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault")
 *                     .build())
 *                 .build())
 *             .diskEncryptionSetName("myDiskEncryptionSet")
 *             .encryptionType("EncryptionAtRestWithCustomerKey")
 *             .identity(EncryptionSetIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .location("West US")
 *             .resourceGroupName("myResourceGroup")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:compute:DiskEncryptionSet myDiskEncryptionSet /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}
 * ```
 * @property activeKey The key vault key which is currently used by this disk encryption set.
 * @property diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
 * @property encryptionType The type of key used to encrypt the data of the disk.
 * @property federatedClientId Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property.
 * @property identity The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks.
 * @property location Resource location
 * @property resourceGroupName The name of the resource group.
 * @property rotationToLatestKeyVersionEnabled Set this flag to true to enable auto-updating of this disk encryption set to the latest key version.
 * @property tags Resource tags
 */
public data class DiskEncryptionSetArgs(
    public val activeKey: Output? = null,
    public val diskEncryptionSetName: Output? = null,
    public val encryptionType: Output>? = null,
    public val federatedClientId: Output? = null,
    public val identity: Output? = null,
    public val location: Output? = null,
    public val resourceGroupName: Output? = null,
    public val rotationToLatestKeyVersionEnabled: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.compute.DiskEncryptionSetArgs =
        com.pulumi.azurenative.compute.DiskEncryptionSetArgs.builder()
            .activeKey(activeKey?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .diskEncryptionSetName(diskEncryptionSetName?.applyValue({ args0 -> args0 }))
            .encryptionType(
                encryptionType?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .federatedClientId(federatedClientId?.applyValue({ args0 -> args0 }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .rotationToLatestKeyVersionEnabled(
                rotationToLatestKeyVersionEnabled?.applyValue({ args0 ->
                    args0
                }),
            )
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [DiskEncryptionSetArgs].
 */
@PulumiTagMarker
public class DiskEncryptionSetArgsBuilder internal constructor() {
    private var activeKey: Output? = null

    private var diskEncryptionSetName: Output? = null

    private var encryptionType: Output>? = null

    private var federatedClientId: Output? = null

    private var identity: Output? = null

    private var location: Output? = null

    private var resourceGroupName: Output? = null

    private var rotationToLatestKeyVersionEnabled: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The key vault key which is currently used by this disk encryption set.
     */
    @JvmName("bdrndvumawmntopw")
    public suspend fun activeKey(`value`: Output) {
        this.activeKey = value
    }

    /**
     * @param value The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
     */
    @JvmName("qjbfcfylgklysmks")
    public suspend fun diskEncryptionSetName(`value`: Output) {
        this.diskEncryptionSetName = value
    }

    /**
     * @param value The type of key used to encrypt the data of the disk.
     */
    @JvmName("sblwigfpxcqetltr")
    public suspend fun encryptionType(`value`: Output>) {
        this.encryptionType = value
    }

    /**
     * @param value Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property.
     */
    @JvmName("uvihywtwbtsipeqy")
    public suspend fun federatedClientId(`value`: Output) {
        this.federatedClientId = value
    }

    /**
     * @param value The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks.
     */
    @JvmName("twdddimgjjlhooep")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

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

    /**
     * @param value The name of the resource group.
     */
    @JvmName("xjkguxbhiaopfwha")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Set this flag to true to enable auto-updating of this disk encryption set to the latest key version.
     */
    @JvmName("gwayrmlclknnowsd")
    public suspend fun rotationToLatestKeyVersionEnabled(`value`: Output) {
        this.rotationToLatestKeyVersionEnabled = value
    }

    /**
     * @param value Resource tags
     */
    @JvmName("rcwplqdoltgnkjbl")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The key vault key which is currently used by this disk encryption set.
     */
    @JvmName("pttlsckvruwvwfmy")
    public suspend fun activeKey(`value`: KeyForDiskEncryptionSetArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.activeKey = mapped
    }

    /**
     * @param argument The key vault key which is currently used by this disk encryption set.
     */
    @JvmName("copeqpwpuwchpjsb")
    public suspend fun activeKey(argument: suspend KeyForDiskEncryptionSetArgsBuilder.() -> Unit) {
        val toBeMapped = KeyForDiskEncryptionSetArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.activeKey = mapped
    }

    /**
     * @param value The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
     */
    @JvmName("qmrfqgctdsjyjaly")
    public suspend fun diskEncryptionSetName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskEncryptionSetName = mapped
    }

    /**
     * @param value The type of key used to encrypt the data of the disk.
     */
    @JvmName("brkwlyecgwbrtyof")
    public suspend fun encryptionType(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.encryptionType = mapped
    }

    /**
     * @param value The type of key used to encrypt the data of the disk.
     */
    @JvmName("fdekkevgdcatfmek")
    public fun encryptionType(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.encryptionType = mapped
    }

    /**
     * @param value The type of key used to encrypt the data of the disk.
     */
    @JvmName("enkpmwndbxvwbwfw")
    public fun encryptionType(`value`: DiskEncryptionSetType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.encryptionType = mapped
    }

    /**
     * @param value Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property.
     */
    @JvmName("qjnlyegmxdntfsit")
    public suspend fun federatedClientId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.federatedClientId = mapped
    }

    /**
     * @param value The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks.
     */
    @JvmName("uxmuqpynxfelfxym")
    public suspend fun identity(`value`: EncryptionSetIdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks.
     */
    @JvmName("wehbcxdadcgvidri")
    public suspend fun identity(argument: suspend EncryptionSetIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = EncryptionSetIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

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

    /**
     * @param value The name of the resource group.
     */
    @JvmName("jifsrxbyioesygpt")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Set this flag to true to enable auto-updating of this disk encryption set to the latest key version.
     */
    @JvmName("lppskqvaxfxmtmuj")
    public suspend fun rotationToLatestKeyVersionEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rotationToLatestKeyVersionEnabled = mapped
    }

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

    /**
     * @param values Resource tags
     */
    @JvmName("pdtaveivrbiigxct")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): DiskEncryptionSetArgs = DiskEncryptionSetArgs(
        activeKey = activeKey,
        diskEncryptionSetName = diskEncryptionSetName,
        encryptionType = encryptionType,
        federatedClientId = federatedClientId,
        identity = identity,
        location = location,
        resourceGroupName = resourceGroupName,
        rotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy