![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.kusto.kotlin.ClusterCustomerManagedKeyArgs.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.kusto.kotlin
import com.pulumi.azure.kusto.ClusterCustomerManagedKeyArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Manages a Customer Managed Key for a Kusto Cluster.
* ## Example Usage
*
* ```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: "examplekv",
* location: example.location,
* resourceGroupName: example.name,
* tenantId: current.then(current => current.tenantId),
* skuName: "standard",
* purgeProtectionEnabled: true,
* });
* const exampleCluster = new azure.kusto.Cluster("example", {
* name: "kustocluster",
* location: example.location,
* resourceGroupName: example.name,
* sku: {
* name: "Standard_D13_v2",
* capacity: 2,
* },
* identity: {
* type: "SystemAssigned",
* },
* });
* const cluster = new azure.keyvault.AccessPolicy("cluster", {
* keyVaultId: exampleKeyVault.id,
* tenantId: current.then(current => current.tenantId),
* objectId: exampleCluster.identity.apply(identity => identity?.principalId),
* keyPermissions: [
* "Get",
* "UnwrapKey",
* "WrapKey",
* ],
* });
* const client = new azure.keyvault.AccessPolicy("client", {
* keyVaultId: exampleKeyVault.id,
* tenantId: current.then(current => current.tenantId),
* objectId: current.then(current => current.objectId),
* keyPermissions: [
* "Get",
* "List",
* "Create",
* "Delete",
* "Recover",
* "GetRotationPolicy",
* ],
* });
* const exampleKey = new azure.keyvault.Key("example", {
* name: "tfex-key",
* keyVaultId: exampleKeyVault.id,
* keyType: "RSA",
* keySize: 2048,
* keyOpts: [
* "decrypt",
* "encrypt",
* "sign",
* "unwrapKey",
* "verify",
* "wrapKey",
* ],
* }, {
* dependsOn: [
* client,
* cluster,
* ],
* });
* const exampleClusterCustomerManagedKey = new azure.kusto.ClusterCustomerManagedKey("example", {
* clusterId: exampleCluster.id,
* keyVaultId: exampleKeyVault.id,
* keyName: exampleKey.name,
* keyVersion: exampleKey.version,
* });
* ```
* ```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="examplekv",
* location=example.location,
* resource_group_name=example.name,
* tenant_id=current.tenant_id,
* sku_name="standard",
* purge_protection_enabled=True)
* example_cluster = azure.kusto.Cluster("example",
* name="kustocluster",
* location=example.location,
* resource_group_name=example.name,
* sku={
* "name": "Standard_D13_v2",
* "capacity": 2,
* },
* identity={
* "type": "SystemAssigned",
* })
* cluster = azure.keyvault.AccessPolicy("cluster",
* key_vault_id=example_key_vault.id,
* tenant_id=current.tenant_id,
* object_id=example_cluster.identity.principal_id,
* key_permissions=[
* "Get",
* "UnwrapKey",
* "WrapKey",
* ])
* client = azure.keyvault.AccessPolicy("client",
* key_vault_id=example_key_vault.id,
* tenant_id=current.tenant_id,
* object_id=current.object_id,
* key_permissions=[
* "Get",
* "List",
* "Create",
* "Delete",
* "Recover",
* "GetRotationPolicy",
* ])
* example_key = azure.keyvault.Key("example",
* name="tfex-key",
* key_vault_id=example_key_vault.id,
* key_type="RSA",
* key_size=2048,
* key_opts=[
* "decrypt",
* "encrypt",
* "sign",
* "unwrapKey",
* "verify",
* "wrapKey",
* ],
* opts = pulumi.ResourceOptions(depends_on=[
* client,
* cluster,
* ]))
* example_cluster_customer_managed_key = azure.kusto.ClusterCustomerManagedKey("example",
* cluster_id=example_cluster.id,
* key_vault_id=example_key_vault.id,
* key_name=example_key.name,
* key_version=example_key.version)
* ```
* ```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 = "examplekv",
* Location = example.Location,
* ResourceGroupName = example.Name,
* TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
* SkuName = "standard",
* PurgeProtectionEnabled = true,
* });
* var exampleCluster = new Azure.Kusto.Cluster("example", new()
* {
* Name = "kustocluster",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Sku = new Azure.Kusto.Inputs.ClusterSkuArgs
* {
* Name = "Standard_D13_v2",
* Capacity = 2,
* },
* Identity = new Azure.Kusto.Inputs.ClusterIdentityArgs
* {
* Type = "SystemAssigned",
* },
* });
* var cluster = new Azure.KeyVault.AccessPolicy("cluster", new()
* {
* KeyVaultId = exampleKeyVault.Id,
* TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
* ObjectId = exampleCluster.Identity.Apply(identity => identity?.PrincipalId),
* KeyPermissions = new[]
* {
* "Get",
* "UnwrapKey",
* "WrapKey",
* },
* });
* var client = new Azure.KeyVault.AccessPolicy("client", new()
* {
* KeyVaultId = exampleKeyVault.Id,
* TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
* ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId),
* KeyPermissions = new[]
* {
* "Get",
* "List",
* "Create",
* "Delete",
* "Recover",
* "GetRotationPolicy",
* },
* });
* var exampleKey = new Azure.KeyVault.Key("example", new()
* {
* Name = "tfex-key",
* KeyVaultId = exampleKeyVault.Id,
* KeyType = "RSA",
* KeySize = 2048,
* KeyOpts = new[]
* {
* "decrypt",
* "encrypt",
* "sign",
* "unwrapKey",
* "verify",
* "wrapKey",
* },
* }, new CustomResourceOptions
* {
* DependsOn =
* {
* client,
* cluster,
* },
* });
* var exampleClusterCustomerManagedKey = new Azure.Kusto.ClusterCustomerManagedKey("example", new()
* {
* ClusterId = exampleCluster.Id,
* KeyVaultId = exampleKeyVault.Id,
* KeyName = exampleKey.Name,
* KeyVersion = exampleKey.Version,
* });
* });
* ```
* ```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-azure/sdk/v5/go/azure/kusto"
* "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("examplekv"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* TenantId: pulumi.String(current.TenantId),
* SkuName: pulumi.String("standard"),
* PurgeProtectionEnabled: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* exampleCluster, err := kusto.NewCluster(ctx, "example", &kusto.ClusterArgs{
* Name: pulumi.String("kustocluster"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Sku: &kusto.ClusterSkuArgs{
* Name: pulumi.String("Standard_D13_v2"),
* Capacity: pulumi.Int(2),
* },
* Identity: &kusto.ClusterIdentityArgs{
* Type: pulumi.String("SystemAssigned"),
* },
* })
* if err != nil {
* return err
* }
* cluster, err := keyvault.NewAccessPolicy(ctx, "cluster", &keyvault.AccessPolicyArgs{
* KeyVaultId: exampleKeyVault.ID(),
* TenantId: pulumi.String(current.TenantId),
* ObjectId: pulumi.String(exampleCluster.Identity.ApplyT(func(identity kusto.ClusterIdentity) (*string, error) {
* return &identity.PrincipalId, nil
* }).(pulumi.StringPtrOutput)),
* KeyPermissions: pulumi.StringArray{
* pulumi.String("Get"),
* pulumi.String("UnwrapKey"),
* pulumi.String("WrapKey"),
* },
* })
* if err != nil {
* return err
* }
* client, err := keyvault.NewAccessPolicy(ctx, "client", &keyvault.AccessPolicyArgs{
* KeyVaultId: exampleKeyVault.ID(),
* TenantId: pulumi.String(current.TenantId),
* ObjectId: pulumi.String(current.ObjectId),
* KeyPermissions: pulumi.StringArray{
* pulumi.String("Get"),
* pulumi.String("List"),
* pulumi.String("Create"),
* pulumi.String("Delete"),
* pulumi.String("Recover"),
* pulumi.String("GetRotationPolicy"),
* },
* })
* if err != nil {
* return err
* }
* exampleKey, err := keyvault.NewKey(ctx, "example", &keyvault.KeyArgs{
* Name: pulumi.String("tfex-key"),
* 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"),
* },
* }, pulumi.DependsOn([]pulumi.Resource{
* client,
* cluster,
* }))
* if err != nil {
* return err
* }
* _, err = kusto.NewClusterCustomerManagedKey(ctx, "example", &kusto.ClusterCustomerManagedKeyArgs{
* ClusterId: exampleCluster.ID(),
* KeyVaultId: exampleKeyVault.ID(),
* KeyName: exampleKey.Name,
* KeyVersion: exampleKey.Version,
* })
* 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.kusto.Cluster;
* import com.pulumi.azure.kusto.ClusterArgs;
* import com.pulumi.azure.kusto.inputs.ClusterSkuArgs;
* import com.pulumi.azure.kusto.inputs.ClusterIdentityArgs;
* import com.pulumi.azure.keyvault.AccessPolicy;
* import com.pulumi.azure.keyvault.AccessPolicyArgs;
* import com.pulumi.azure.keyvault.Key;
* import com.pulumi.azure.keyvault.KeyArgs;
* import com.pulumi.azure.kusto.ClusterCustomerManagedKey;
* import com.pulumi.azure.kusto.ClusterCustomerManagedKeyArgs;
* import com.pulumi.resources.CustomResourceOptions;
* 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("examplekv")
* .location(example.location())
* .resourceGroupName(example.name())
* .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
* .skuName("standard")
* .purgeProtectionEnabled(true)
* .build());
* var exampleCluster = new Cluster("exampleCluster", ClusterArgs.builder()
* .name("kustocluster")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku(ClusterSkuArgs.builder()
* .name("Standard_D13_v2")
* .capacity(2)
* .build())
* .identity(ClusterIdentityArgs.builder()
* .type("SystemAssigned")
* .build())
* .build());
* var cluster = new AccessPolicy("cluster", AccessPolicyArgs.builder()
* .keyVaultId(exampleKeyVault.id())
* .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
* .objectId(exampleCluster.identity().applyValue(identity -> identity.principalId()))
* .keyPermissions(
* "Get",
* "UnwrapKey",
* "WrapKey")
* .build());
* var client = new AccessPolicy("client", AccessPolicyArgs.builder()
* .keyVaultId(exampleKeyVault.id())
* .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
* .objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
* .keyPermissions(
* "Get",
* "List",
* "Create",
* "Delete",
* "Recover",
* "GetRotationPolicy")
* .build());
* var exampleKey = new Key("exampleKey", KeyArgs.builder()
* .name("tfex-key")
* .keyVaultId(exampleKeyVault.id())
* .keyType("RSA")
* .keySize(2048)
* .keyOpts(
* "decrypt",
* "encrypt",
* "sign",
* "unwrapKey",
* "verify",
* "wrapKey")
* .build(), CustomResourceOptions.builder()
* .dependsOn(
* client,
* cluster)
* .build());
* var exampleClusterCustomerManagedKey = new ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", ClusterCustomerManagedKeyArgs.builder()
* .clusterId(exampleCluster.id())
* .keyVaultId(exampleKeyVault.id())
* .keyName(exampleKey.name())
* .keyVersion(exampleKey.version())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleKeyVault:
* type: azure:keyvault:KeyVault
* name: example
* properties:
* name: examplekv
* location: ${example.location}
* resourceGroupName: ${example.name}
* tenantId: ${current.tenantId}
* skuName: standard
* purgeProtectionEnabled: true
* cluster:
* type: azure:keyvault:AccessPolicy
* properties:
* keyVaultId: ${exampleKeyVault.id}
* tenantId: ${current.tenantId}
* objectId: ${exampleCluster.identity.principalId}
* keyPermissions:
* - Get
* - UnwrapKey
* - WrapKey
* client:
* type: azure:keyvault:AccessPolicy
* properties:
* keyVaultId: ${exampleKeyVault.id}
* tenantId: ${current.tenantId}
* objectId: ${current.objectId}
* keyPermissions:
* - Get
* - List
* - Create
* - Delete
* - Recover
* - GetRotationPolicy
* exampleKey:
* type: azure:keyvault:Key
* name: example
* properties:
* name: tfex-key
* keyVaultId: ${exampleKeyVault.id}
* keyType: RSA
* keySize: 2048
* keyOpts:
* - decrypt
* - encrypt
* - sign
* - unwrapKey
* - verify
* - wrapKey
* options:
* dependson:
* - ${client}
* - ${cluster}
* exampleCluster:
* type: azure:kusto:Cluster
* name: example
* properties:
* name: kustocluster
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku:
* name: Standard_D13_v2
* capacity: 2
* identity:
* type: SystemAssigned
* exampleClusterCustomerManagedKey:
* type: azure:kusto:ClusterCustomerManagedKey
* name: example
* properties:
* clusterId: ${exampleCluster.id}
* keyVaultId: ${exampleKeyVault.id}
* keyName: ${exampleKey.name}
* keyVersion: ${exampleKey.version}
* variables:
* current:
* fn::invoke:
* Function: azure:core:getClientConfig
* Arguments: {}
* ```
*
* ## Import
* Customer Managed Keys for a Kusto Cluster can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:kusto/clusterCustomerManagedKey:ClusterCustomerManagedKey example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Kusto/clusters/cluster1
* ```
* @property clusterId The ID of the Kusto Cluster. Changing this forces a new resource to be created.
* @property keyName The name of Key Vault Key.
* @property keyVaultId The ID of the Key Vault.
* @property keyVersion The version of Key Vault Key.
* @property userIdentity The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.
*/
public data class ClusterCustomerManagedKeyArgs(
public val clusterId: Output? = null,
public val keyName: Output? = null,
public val keyVaultId: Output? = null,
public val keyVersion: Output? = null,
public val userIdentity: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.kusto.ClusterCustomerManagedKeyArgs =
com.pulumi.azure.kusto.ClusterCustomerManagedKeyArgs.builder()
.clusterId(clusterId?.applyValue({ args0 -> args0 }))
.keyName(keyName?.applyValue({ args0 -> args0 }))
.keyVaultId(keyVaultId?.applyValue({ args0 -> args0 }))
.keyVersion(keyVersion?.applyValue({ args0 -> args0 }))
.userIdentity(userIdentity?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ClusterCustomerManagedKeyArgs].
*/
@PulumiTagMarker
public class ClusterCustomerManagedKeyArgsBuilder internal constructor() {
private var clusterId: Output? = null
private var keyName: Output? = null
private var keyVaultId: Output? = null
private var keyVersion: Output? = null
private var userIdentity: Output? = null
/**
* @param value The ID of the Kusto Cluster. Changing this forces a new resource to be created.
*/
@JvmName("jcnxgqyxixhrohut")
public suspend fun clusterId(`value`: Output) {
this.clusterId = value
}
/**
* @param value The name of Key Vault Key.
*/
@JvmName("rgdsnwtdlfqwwkjf")
public suspend fun keyName(`value`: Output) {
this.keyName = value
}
/**
* @param value The ID of the Key Vault.
*/
@JvmName("vtxnmhexshuhijqn")
public suspend fun keyVaultId(`value`: Output) {
this.keyVaultId = value
}
/**
* @param value The version of Key Vault Key.
*/
@JvmName("fcntoymorrljyvap")
public suspend fun keyVersion(`value`: Output) {
this.keyVersion = value
}
/**
* @param value The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.
*/
@JvmName("vajmntvvbfrkopos")
public suspend fun userIdentity(`value`: Output) {
this.userIdentity = value
}
/**
* @param value The ID of the Kusto Cluster. Changing this forces a new resource to be created.
*/
@JvmName("ecqgoxseeaeudgvn")
public suspend fun clusterId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.clusterId = mapped
}
/**
* @param value The name of Key Vault Key.
*/
@JvmName("cbgadktnhyludgkn")
public suspend fun keyName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.keyName = mapped
}
/**
* @param value The ID of the Key Vault.
*/
@JvmName("ytrqpqcpmarlsyru")
public suspend fun keyVaultId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.keyVaultId = mapped
}
/**
* @param value The version of Key Vault Key.
*/
@JvmName("pdeowtpqdnkajhhg")
public suspend fun keyVersion(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.keyVersion = mapped
}
/**
* @param value The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.
*/
@JvmName("bosoiaxqraajnuef")
public suspend fun userIdentity(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.userIdentity = mapped
}
internal fun build(): ClusterCustomerManagedKeyArgs = ClusterCustomerManagedKeyArgs(
clusterId = clusterId,
keyName = keyName,
keyVaultId = keyVaultId,
keyVersion = keyVersion,
userIdentity = userIdentity,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy