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

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

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.keyvault.kotlin

import com.pulumi.azure.keyvault.KeyArgs.builder
import com.pulumi.azure.keyvault.kotlin.inputs.KeyRotationPolicyArgs
import com.pulumi.azure.keyvault.kotlin.inputs.KeyRotationPolicyArgsBuilder
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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Key Vault Key.
 * ## Example Usage
 * > **Note:** To use this resource, your client should have RBAC roles with permissions like `Key Vault Crypto Officer` or `Key Vault Administrator` or an assigned Key Vault Access Policy with permissions `Create`,`Delete`,`Get`,`Purge`,`Recover`,`Update` and `GetRotationPolicy` for keys without Rotation Policy. Include `SetRotationPolicy` for keys with Rotation Policy.
 * > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Key resource on destroy, rather than the default soft-delete. See `purge_soft_deleted_keys_on_destroy` for more information.
 * ### Additional Examples
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const current = azure.core.getClientConfig({});
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleKeyVault = new azure.keyvault.KeyVault("example", {
 *     name: "examplekeyvault",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     tenantId: current.then(current => current.tenantId),
 *     skuName: "premium",
 *     softDeleteRetentionDays: 7,
 *     accessPolicies: [{
 *         tenantId: current.then(current => current.tenantId),
 *         objectId: current.then(current => current.objectId),
 *         keyPermissions: [
 *             "Create",
 *             "Delete",
 *             "Get",
 *             "Purge",
 *             "Recover",
 *             "Update",
 *             "GetRotationPolicy",
 *             "SetRotationPolicy",
 *         ],
 *         secretPermissions: ["Set"],
 *     }],
 * });
 * const generated = new azure.keyvault.Key("generated", {
 *     name: "generated-certificate",
 *     keyVaultId: exampleKeyVault.id,
 *     keyType: "RSA",
 *     keySize: 2048,
 *     keyOpts: [
 *         "decrypt",
 *         "encrypt",
 *         "sign",
 *         "unwrapKey",
 *         "verify",
 *         "wrapKey",
 *     ],
 *     rotationPolicy: {
 *         automatic: {
 *             timeBeforeExpiry: "P30D",
 *         },
 *         expireAfter: "P90D",
 *         notifyBeforeExpiry: "P29D",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * current = azure.core.get_client_config()
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_key_vault = azure.keyvault.KeyVault("example",
 *     name="examplekeyvault",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     tenant_id=current.tenant_id,
 *     sku_name="premium",
 *     soft_delete_retention_days=7,
 *     access_policies=[{
 *         "tenant_id": current.tenant_id,
 *         "object_id": current.object_id,
 *         "key_permissions": [
 *             "Create",
 *             "Delete",
 *             "Get",
 *             "Purge",
 *             "Recover",
 *             "Update",
 *             "GetRotationPolicy",
 *             "SetRotationPolicy",
 *         ],
 *         "secret_permissions": ["Set"],
 *     }])
 * generated = azure.keyvault.Key("generated",
 *     name="generated-certificate",
 *     key_vault_id=example_key_vault.id,
 *     key_type="RSA",
 *     key_size=2048,
 *     key_opts=[
 *         "decrypt",
 *         "encrypt",
 *         "sign",
 *         "unwrapKey",
 *         "verify",
 *         "wrapKey",
 *     ],
 *     rotation_policy={
 *         "automatic": {
 *             "time_before_expiry": "P30D",
 *         },
 *         "expire_after": "P90D",
 *         "notify_before_expiry": "P29D",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var current = Azure.Core.GetClientConfig.Invoke();
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleKeyVault = new Azure.KeyVault.KeyVault("example", new()
 *     {
 *         Name = "examplekeyvault",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
 *         SkuName = "premium",
 *         SoftDeleteRetentionDays = 7,
 *         AccessPolicies = new[]
 *         {
 *             new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs
 *             {
 *                 TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
 *                 ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId),
 *                 KeyPermissions = new[]
 *                 {
 *                     "Create",
 *                     "Delete",
 *                     "Get",
 *                     "Purge",
 *                     "Recover",
 *                     "Update",
 *                     "GetRotationPolicy",
 *                     "SetRotationPolicy",
 *                 },
 *                 SecretPermissions = new[]
 *                 {
 *                     "Set",
 *                 },
 *             },
 *         },
 *     });
 *     var generated = new Azure.KeyVault.Key("generated", new()
 *     {
 *         Name = "generated-certificate",
 *         KeyVaultId = exampleKeyVault.Id,
 *         KeyType = "RSA",
 *         KeySize = 2048,
 *         KeyOpts = new[]
 *         {
 *             "decrypt",
 *             "encrypt",
 *             "sign",
 *             "unwrapKey",
 *             "verify",
 *             "wrapKey",
 *         },
 *         RotationPolicy = new Azure.KeyVault.Inputs.KeyRotationPolicyArgs
 *         {
 *             Automatic = new Azure.KeyVault.Inputs.KeyRotationPolicyAutomaticArgs
 *             {
 *                 TimeBeforeExpiry = "P30D",
 *             },
 *             ExpireAfter = "P90D",
 *             NotifyBeforeExpiry = "P29D",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		current, err := core.GetClientConfig(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleKeyVault, err := keyvault.NewKeyVault(ctx, "example", &keyvault.KeyVaultArgs{
 * 			Name:                    pulumi.String("examplekeyvault"),
 * 			Location:                example.Location,
 * 			ResourceGroupName:       example.Name,
 * 			TenantId:                pulumi.String(current.TenantId),
 * 			SkuName:                 pulumi.String("premium"),
 * 			SoftDeleteRetentionDays: pulumi.Int(7),
 * 			AccessPolicies: keyvault.KeyVaultAccessPolicyArray{
 * 				&keyvault.KeyVaultAccessPolicyArgs{
 * 					TenantId: pulumi.String(current.TenantId),
 * 					ObjectId: pulumi.String(current.ObjectId),
 * 					KeyPermissions: pulumi.StringArray{
 * 						pulumi.String("Create"),
 * 						pulumi.String("Delete"),
 * 						pulumi.String("Get"),
 * 						pulumi.String("Purge"),
 * 						pulumi.String("Recover"),
 * 						pulumi.String("Update"),
 * 						pulumi.String("GetRotationPolicy"),
 * 						pulumi.String("SetRotationPolicy"),
 * 					},
 * 					SecretPermissions: pulumi.StringArray{
 * 						pulumi.String("Set"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = keyvault.NewKey(ctx, "generated", &keyvault.KeyArgs{
 * 			Name:       pulumi.String("generated-certificate"),
 * 			KeyVaultId: exampleKeyVault.ID(),
 * 			KeyType:    pulumi.String("RSA"),
 * 			KeySize:    pulumi.Int(2048),
 * 			KeyOpts: pulumi.StringArray{
 * 				pulumi.String("decrypt"),
 * 				pulumi.String("encrypt"),
 * 				pulumi.String("sign"),
 * 				pulumi.String("unwrapKey"),
 * 				pulumi.String("verify"),
 * 				pulumi.String("wrapKey"),
 * 			},
 * 			RotationPolicy: &keyvault.KeyRotationPolicyArgs{
 * 				Automatic: &keyvault.KeyRotationPolicyAutomaticArgs{
 * 					TimeBeforeExpiry: pulumi.String("P30D"),
 * 				},
 * 				ExpireAfter:        pulumi.String("P90D"),
 * 				NotifyBeforeExpiry: pulumi.String("P29D"),
 * 			},
 * 		})
 * 		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.azure.core.CoreFunctions;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.keyvault.KeyVault;
 * import com.pulumi.azure.keyvault.KeyVaultArgs;
 * import com.pulumi.azure.keyvault.inputs.KeyVaultAccessPolicyArgs;
 * import com.pulumi.azure.keyvault.Key;
 * import com.pulumi.azure.keyvault.KeyArgs;
 * import com.pulumi.azure.keyvault.inputs.KeyRotationPolicyArgs;
 * import com.pulumi.azure.keyvault.inputs.KeyRotationPolicyAutomaticArgs;
 * 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) {
 *         final var current = CoreFunctions.getClientConfig();
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
 *             .name("examplekeyvault")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *             .skuName("premium")
 *             .softDeleteRetentionDays(7)
 *             .accessPolicies(KeyVaultAccessPolicyArgs.builder()
 *                 .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *                 .objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
 *                 .keyPermissions(
 *                     "Create",
 *                     "Delete",
 *                     "Get",
 *                     "Purge",
 *                     "Recover",
 *                     "Update",
 *                     "GetRotationPolicy",
 *                     "SetRotationPolicy")
 *                 .secretPermissions("Set")
 *                 .build())
 *             .build());
 *         var generated = new Key("generated", KeyArgs.builder()
 *             .name("generated-certificate")
 *             .keyVaultId(exampleKeyVault.id())
 *             .keyType("RSA")
 *             .keySize(2048)
 *             .keyOpts(
 *                 "decrypt",
 *                 "encrypt",
 *                 "sign",
 *                 "unwrapKey",
 *                 "verify",
 *                 "wrapKey")
 *             .rotationPolicy(KeyRotationPolicyArgs.builder()
 *                 .automatic(KeyRotationPolicyAutomaticArgs.builder()
 *                     .timeBeforeExpiry("P30D")
 *                     .build())
 *                 .expireAfter("P90D")
 *                 .notifyBeforeExpiry("P29D")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleKeyVault:
 *     type: azure:keyvault:KeyVault
 *     name: example
 *     properties:
 *       name: examplekeyvault
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       tenantId: ${current.tenantId}
 *       skuName: premium
 *       softDeleteRetentionDays: 7
 *       accessPolicies:
 *         - tenantId: ${current.tenantId}
 *           objectId: ${current.objectId}
 *           keyPermissions:
 *             - Create
 *             - Delete
 *             - Get
 *             - Purge
 *             - Recover
 *             - Update
 *             - GetRotationPolicy
 *             - SetRotationPolicy
 *           secretPermissions:
 *             - Set
 *   generated:
 *     type: azure:keyvault:Key
 *     properties:
 *       name: generated-certificate
 *       keyVaultId: ${exampleKeyVault.id}
 *       keyType: RSA
 *       keySize: 2048
 *       keyOpts:
 *         - decrypt
 *         - encrypt
 *         - sign
 *         - unwrapKey
 *         - verify
 *         - wrapKey
 *       rotationPolicy:
 *         automatic:
 *           timeBeforeExpiry: P30D
 *         expireAfter: P90D
 *         notifyBeforeExpiry: P29D
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getClientConfig
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Key Vault Key which is Enabled can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:keyvault/key:Key example "https://example-keyvault.vault.azure.net/keys/example/fdf067c93bbb4b22bff4d8b7a9a56217"
 * ```
 * @property curve Specifies the curve to use when creating an `EC` key. Possible values are `P-256`, `P-256K`, `P-384`, and `P-521`. This field will be required in a future release if `key_type` is `EC` or `EC-HSM`. The API will default to `P-256` if nothing is specified. Changing this forces a new resource to be created.
 * @property expirationDate Expiration UTC datetime (Y-m-d'T'H:M:S'Z'). When this parameter gets changed on reruns, if newer date is ahead of current date, an update is performed. If the newer date is before the current date, resource will be force created.
 * @property keyOpts A list of JSON web key operations. Possible values include: `decrypt`, `encrypt`, `sign`, `unwrapKey`, `verify` and `wrapKey`. Please note these values are case sensitive.
 * @property keySize Specifies the Size of the RSA key to create in bytes. For example, 1024 or 2048. *Note*: This field is required if `key_type` is `RSA` or `RSA-HSM`. Changing this forces a new resource to be created.
 * @property keyType Specifies the Key Type to use for this Key Vault Key. Possible values are `EC` (Elliptic Curve), `EC-HSM`, `RSA` and `RSA-HSM`. Changing this forces a new resource to be created.
 * @property keyVaultId The ID of the Key Vault where the Key should be created. Changing this forces a new resource to be created.
 * @property name Specifies the name of the Key Vault Key. Changing this forces a new resource to be created.
 * @property notBeforeDate Key not usable before the provided UTC datetime (Y-m-d'T'H:M:S'Z').
 * > **Note:** Once `expiration_date` is set, it's not possible to unset the key even if it is deleted & recreated as underlying Azure API uses the restore of the purged key.
 * @property rotationPolicy A `rotation_policy` block as defined below.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class KeyArgs(
    public val curve: Output? = null,
    public val expirationDate: Output? = null,
    public val keyOpts: Output>? = null,
    public val keySize: Output? = null,
    public val keyType: Output? = null,
    public val keyVaultId: Output? = null,
    public val name: Output? = null,
    public val notBeforeDate: Output? = null,
    public val rotationPolicy: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.keyvault.KeyArgs =
        com.pulumi.azure.keyvault.KeyArgs.builder()
            .curve(curve?.applyValue({ args0 -> args0 }))
            .expirationDate(expirationDate?.applyValue({ args0 -> args0 }))
            .keyOpts(keyOpts?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .keySize(keySize?.applyValue({ args0 -> args0 }))
            .keyType(keyType?.applyValue({ args0 -> args0 }))
            .keyVaultId(keyVaultId?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .notBeforeDate(notBeforeDate?.applyValue({ args0 -> args0 }))
            .rotationPolicy(rotationPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [KeyArgs].
 */
@PulumiTagMarker
public class KeyArgsBuilder internal constructor() {
    private var curve: Output? = null

    private var expirationDate: Output? = null

    private var keyOpts: Output>? = null

    private var keySize: Output? = null

    private var keyType: Output? = null

    private var keyVaultId: Output? = null

    private var name: Output? = null

    private var notBeforeDate: Output? = null

    private var rotationPolicy: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Specifies the curve to use when creating an `EC` key. Possible values are `P-256`, `P-256K`, `P-384`, and `P-521`. This field will be required in a future release if `key_type` is `EC` or `EC-HSM`. The API will default to `P-256` if nothing is specified. Changing this forces a new resource to be created.
     */
    @JvmName("galbuwsalxnbslvg")
    public suspend fun curve(`value`: Output) {
        this.curve = value
    }

    /**
     * @param value Expiration UTC datetime (Y-m-d'T'H:M:S'Z'). When this parameter gets changed on reruns, if newer date is ahead of current date, an update is performed. If the newer date is before the current date, resource will be force created.
     */
    @JvmName("jvikxxgxsrxhpkep")
    public suspend fun expirationDate(`value`: Output) {
        this.expirationDate = value
    }

    /**
     * @param value A list of JSON web key operations. Possible values include: `decrypt`, `encrypt`, `sign`, `unwrapKey`, `verify` and `wrapKey`. Please note these values are case sensitive.
     */
    @JvmName("meefkkduawxcasdf")
    public suspend fun keyOpts(`value`: Output>) {
        this.keyOpts = value
    }

    @JvmName("iqardcdxvhbqiacp")
    public suspend fun keyOpts(vararg values: Output) {
        this.keyOpts = Output.all(values.asList())
    }

    /**
     * @param values A list of JSON web key operations. Possible values include: `decrypt`, `encrypt`, `sign`, `unwrapKey`, `verify` and `wrapKey`. Please note these values are case sensitive.
     */
    @JvmName("mqkrbfcdkofsavmu")
    public suspend fun keyOpts(values: List>) {
        this.keyOpts = Output.all(values)
    }

    /**
     * @param value Specifies the Size of the RSA key to create in bytes. For example, 1024 or 2048. *Note*: This field is required if `key_type` is `RSA` or `RSA-HSM`. Changing this forces a new resource to be created.
     */
    @JvmName("npedbrdeiudooutg")
    public suspend fun keySize(`value`: Output) {
        this.keySize = value
    }

    /**
     * @param value Specifies the Key Type to use for this Key Vault Key. Possible values are `EC` (Elliptic Curve), `EC-HSM`, `RSA` and `RSA-HSM`. Changing this forces a new resource to be created.
     */
    @JvmName("xwpsvowgvoorbtss")
    public suspend fun keyType(`value`: Output) {
        this.keyType = value
    }

    /**
     * @param value The ID of the Key Vault where the Key should be created. Changing this forces a new resource to be created.
     */
    @JvmName("wldkxhtqoguqhwja")
    public suspend fun keyVaultId(`value`: Output) {
        this.keyVaultId = value
    }

    /**
     * @param value Specifies the name of the Key Vault Key. Changing this forces a new resource to be created.
     */
    @JvmName("gmvsrjguicrexajs")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Key not usable before the provided UTC datetime (Y-m-d'T'H:M:S'Z').
     * > **Note:** Once `expiration_date` is set, it's not possible to unset the key even if it is deleted & recreated as underlying Azure API uses the restore of the purged key.
     */
    @JvmName("rfbnfvmapsrhamxh")
    public suspend fun notBeforeDate(`value`: Output) {
        this.notBeforeDate = value
    }

    /**
     * @param value A `rotation_policy` block as defined below.
     */
    @JvmName("hcrsjlnoculclrph")
    public suspend fun rotationPolicy(`value`: Output) {
        this.rotationPolicy = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("ftjbsvamxaswnjrl")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Specifies the curve to use when creating an `EC` key. Possible values are `P-256`, `P-256K`, `P-384`, and `P-521`. This field will be required in a future release if `key_type` is `EC` or `EC-HSM`. The API will default to `P-256` if nothing is specified. Changing this forces a new resource to be created.
     */
    @JvmName("tckcqvvqboffbxqf")
    public suspend fun curve(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.curve = mapped
    }

    /**
     * @param value Expiration UTC datetime (Y-m-d'T'H:M:S'Z'). When this parameter gets changed on reruns, if newer date is ahead of current date, an update is performed. If the newer date is before the current date, resource will be force created.
     */
    @JvmName("osmftjtisclmujnt")
    public suspend fun expirationDate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expirationDate = mapped
    }

    /**
     * @param value A list of JSON web key operations. Possible values include: `decrypt`, `encrypt`, `sign`, `unwrapKey`, `verify` and `wrapKey`. Please note these values are case sensitive.
     */
    @JvmName("crgtckeegigqovjy")
    public suspend fun keyOpts(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.keyOpts = mapped
    }

    /**
     * @param values A list of JSON web key operations. Possible values include: `decrypt`, `encrypt`, `sign`, `unwrapKey`, `verify` and `wrapKey`. Please note these values are case sensitive.
     */
    @JvmName("muvblavhmrcnfgae")
    public suspend fun keyOpts(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.keyOpts = mapped
    }

    /**
     * @param value Specifies the Size of the RSA key to create in bytes. For example, 1024 or 2048. *Note*: This field is required if `key_type` is `RSA` or `RSA-HSM`. Changing this forces a new resource to be created.
     */
    @JvmName("cknfjygkjiejhwwr")
    public suspend fun keySize(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.keySize = mapped
    }

    /**
     * @param value Specifies the Key Type to use for this Key Vault Key. Possible values are `EC` (Elliptic Curve), `EC-HSM`, `RSA` and `RSA-HSM`. Changing this forces a new resource to be created.
     */
    @JvmName("ylmqmdunbisqecbw")
    public suspend fun keyType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.keyType = mapped
    }

    /**
     * @param value The ID of the Key Vault where the Key should be created. Changing this forces a new resource to be created.
     */
    @JvmName("iokmlgnqncngjfop")
    public suspend fun keyVaultId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.keyVaultId = mapped
    }

    /**
     * @param value Specifies the name of the Key Vault Key. Changing this forces a new resource to be created.
     */
    @JvmName("ymepfaewopvlgdhs")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Key not usable before the provided UTC datetime (Y-m-d'T'H:M:S'Z').
     * > **Note:** Once `expiration_date` is set, it's not possible to unset the key even if it is deleted & recreated as underlying Azure API uses the restore of the purged key.
     */
    @JvmName("xwvqsaxaxofpvpfj")
    public suspend fun notBeforeDate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notBeforeDate = mapped
    }

    /**
     * @param value A `rotation_policy` block as defined below.
     */
    @JvmName("miqaacaxngvsyuqx")
    public suspend fun rotationPolicy(`value`: KeyRotationPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rotationPolicy = mapped
    }

    /**
     * @param argument A `rotation_policy` block as defined below.
     */
    @JvmName("mgsgypyilshvshax")
    public suspend fun rotationPolicy(argument: suspend KeyRotationPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = KeyRotationPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.rotationPolicy = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("yvfqmgibsahnrskl")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("wvcspewgteafmnvv")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): KeyArgs = KeyArgs(
        curve = curve,
        expirationDate = expirationDate,
        keyOpts = keyOpts,
        keySize = keySize,
        keyType = keyType,
        keyVaultId = keyVaultId,
        name = name,
        notBeforeDate = notBeforeDate,
        rotationPolicy = rotationPolicy,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy