Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.14.0 published on Thursday, Jul 28, 2022 by Pulumi

ClusterCustomerManagedKey

Manages a Customer Managed Key for a Kusto Cluster.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var current = Output.Create(Azure.Core.GetClientConfig.InvokeAsync());
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "West Europe",
        });
        var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new Azure.KeyVault.KeyVaultArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            TenantId = current.Apply(current => current.TenantId),
            SkuName = "standard",
            PurgeProtectionEnabled = true,
        });
        var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new Azure.Kusto.ClusterArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.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 Azure.KeyVault.AccessPolicyArgs
        {
            KeyVaultId = exampleKeyVault.Id,
            TenantId = current.Apply(current => current.TenantId),
            ObjectId = exampleCluster.Identity.Apply(identity => identity?.PrincipalId),
            KeyPermissions = 
            {
                "Get",
                "UnwrapKey",
                "WrapKey",
            },
        });
        var client = new Azure.KeyVault.AccessPolicy("client", new Azure.KeyVault.AccessPolicyArgs
        {
            KeyVaultId = exampleKeyVault.Id,
            TenantId = current.Apply(current => current.TenantId),
            ObjectId = current.Apply(current => current.ObjectId),
            KeyPermissions = 
            {
                "Get",
                "List",
                "Create",
                "Delete",
                "Recover",
            },
        });
        var exampleKey = new Azure.KeyVault.Key("exampleKey", new Azure.KeyVault.KeyArgs
        {
            KeyVaultId = exampleKeyVault.Id,
            KeyType = "RSA",
            KeySize = 2048,
            KeyOpts = 
            {
                "decrypt",
                "encrypt",
                "sign",
                "unwrapKey",
                "verify",
                "wrapKey",
            },
        }, new CustomResourceOptions
        {
            DependsOn = 
            {
                client,
                cluster,
            },
        });
        var exampleClusterCustomerManagedKey = new Azure.Kusto.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", new Azure.Kusto.ClusterCustomerManagedKeyArgs
        {
            ClusterId = exampleCluster.Id,
            KeyVaultId = exampleKeyVault.Id,
            KeyName = exampleKey.Name,
            KeyVersion = exampleKey.Version,
        });
    }

}
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
		}
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{
			Location:               exampleResourceGroup.Location,
			ResourceGroupName:      exampleResourceGroup.Name,
			TenantId:               pulumi.String(current.TenantId),
			SkuName:                pulumi.String("standard"),
			PurgeProtectionEnabled: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.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: exampleCluster.Identity.ApplyT(func(identity kusto.ClusterIdentity) (string, error) {
				return identity.PrincipalId, nil
			}).(pulumi.StringOutput),
			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"),
			},
		})
		if err != nil {
			return err
		}
		exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{
			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, "exampleClusterCustomerManagedKey", &kusto.ClusterCustomerManagedKeyArgs{
			ClusterId:  exampleCluster.ID(),
			KeyVaultId: exampleKeyVault.ID(),
			KeyName:    exampleKey.Name,
			KeyVersion: exampleKey.Version,
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_azure as azure

current = azure.core.get_client_config()
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_key_vault = azure.keyvault.KeyVault("exampleKeyVault",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    tenant_id=current.tenant_id,
    sku_name="standard",
    purge_protection_enabled=True)
example_cluster = azure.kusto.Cluster("exampleCluster",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku=azure.kusto.ClusterSkuArgs(
        name="Standard_D13_v2",
        capacity=2,
    ),
    identity=azure.kusto.ClusterIdentityArgs(
        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",
    ])
example_key = azure.keyvault.Key("exampleKey",
    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("exampleClusterCustomerManagedKey",
    cluster_id=example_cluster.id,
    key_vault_id=example_key_vault.id,
    key_name=example_key.name,
    key_version=example_key.version)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const current = azure.core.getClientConfig({});
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    tenantId: current.then(current => current.tenantId),
    skuName: "standard",
    purgeProtectionEnabled: true,
});
const exampleCluster = new azure.kusto.Cluster("exampleCluster", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.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",
    ],
});
const exampleKey = new azure.keyvault.Key("exampleKey", {
    keyVaultId: exampleKeyVault.id,
    keyType: "RSA",
    keySize: 2048,
    keyOpts: [
        "decrypt",
        "encrypt",
        "sign",
        "unwrapKey",
        "verify",
        "wrapKey",
    ],
}, {
    dependsOn: [
        client,
        cluster,
    ],
});
const exampleClusterCustomerManagedKey = new azure.kusto.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", {
    clusterId: exampleCluster.id,
    keyVaultId: exampleKeyVault.id,
    keyName: exampleKey.name,
    keyVersion: exampleKey.version,
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleKeyVault:
    type: azure:keyvault:KeyVault
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.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
  exampleKey:
    type: azure:keyvault:Key
    properties:
      keyVaultId: ${exampleKeyVault.id}
      keyType: RSA
      keySize: 2048
      keyOpts:
        - decrypt
        - encrypt
        - sign
        - unwrapKey
        - verify
        - wrapKey
    options:
      dependson:
        - ${client}
        - ${cluster}
  exampleCluster:
    type: azure:kusto:Cluster
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      sku:
        name: Standard_D13_v2
        capacity: 2
      identity:
        type: SystemAssigned
  exampleClusterCustomerManagedKey:
    type: azure:kusto:ClusterCustomerManagedKey
    properties:
      clusterId: ${exampleCluster.id}
      keyVaultId: ${exampleKeyVault.id}
      keyName: ${exampleKey.name}
      keyVersion: ${exampleKey.version}
variables:
  current:
    Fn::Invoke:
      Function: azure:core:getClientConfig
      Arguments: {}

Create a ClusterCustomerManagedKey Resource

new ClusterCustomerManagedKey(name: string, args: ClusterCustomerManagedKeyArgs, opts?: CustomResourceOptions);
@overload
def ClusterCustomerManagedKey(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              cluster_id: Optional[str] = None,
                              key_name: Optional[str] = None,
                              key_vault_id: Optional[str] = None,
                              key_version: Optional[str] = None,
                              user_identity: Optional[str] = None)
@overload
def ClusterCustomerManagedKey(resource_name: str,
                              args: ClusterCustomerManagedKeyArgs,
                              opts: Optional[ResourceOptions] = None)
func NewClusterCustomerManagedKey(ctx *Context, name string, args ClusterCustomerManagedKeyArgs, opts ...ResourceOption) (*ClusterCustomerManagedKey, error)
public ClusterCustomerManagedKey(string name, ClusterCustomerManagedKeyArgs args, CustomResourceOptions? opts = null)
public ClusterCustomerManagedKey(String name, ClusterCustomerManagedKeyArgs args)
public ClusterCustomerManagedKey(String name, ClusterCustomerManagedKeyArgs args, CustomResourceOptions options)
type: azure:kusto:ClusterCustomerManagedKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ClusterCustomerManagedKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ClusterCustomerManagedKeyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ClusterCustomerManagedKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ClusterCustomerManagedKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ClusterCustomerManagedKeyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ClusterCustomerManagedKey Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ClusterCustomerManagedKey resource accepts the following input properties:

ClusterId string

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

KeyName string

The name of Key Vault Key.

KeyVaultId string

The ID of the Key Vault. Changing this forces a new resource to be created.

KeyVersion string

The version of Key Vault Key.

UserIdentity string

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

ClusterId string

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

KeyName string

The name of Key Vault Key.

KeyVaultId string

The ID of the Key Vault. Changing this forces a new resource to be created.

KeyVersion string

The version of Key Vault Key.

UserIdentity string

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

clusterId String

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

keyName String

The name of Key Vault Key.

keyVaultId String

The ID of the Key Vault. Changing this forces a new resource to be created.

keyVersion String

The version of Key Vault Key.

userIdentity String

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

clusterId string

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

keyName string

The name of Key Vault Key.

keyVaultId string

The ID of the Key Vault. Changing this forces a new resource to be created.

keyVersion string

The version of Key Vault Key.

userIdentity string

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

cluster_id str

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

key_name str

The name of Key Vault Key.

key_vault_id str

The ID of the Key Vault. Changing this forces a new resource to be created.

key_version str

The version of Key Vault Key.

user_identity str

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

clusterId String

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

keyName String

The name of Key Vault Key.

keyVaultId String

The ID of the Key Vault. Changing this forces a new resource to be created.

keyVersion String

The version of Key Vault Key.

userIdentity String

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

Outputs

All input properties are implicitly available as output properties. Additionally, the ClusterCustomerManagedKey resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing ClusterCustomerManagedKey Resource

Get an existing ClusterCustomerManagedKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ClusterCustomerManagedKeyState, opts?: CustomResourceOptions): ClusterCustomerManagedKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        key_name: Optional[str] = None,
        key_vault_id: Optional[str] = None,
        key_version: Optional[str] = None,
        user_identity: Optional[str] = None) -> ClusterCustomerManagedKey
func GetClusterCustomerManagedKey(ctx *Context, name string, id IDInput, state *ClusterCustomerManagedKeyState, opts ...ResourceOption) (*ClusterCustomerManagedKey, error)
public static ClusterCustomerManagedKey Get(string name, Input<string> id, ClusterCustomerManagedKeyState? state, CustomResourceOptions? opts = null)
public static ClusterCustomerManagedKey get(String name, Output<String> id, ClusterCustomerManagedKeyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ClusterId string

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

KeyName string

The name of Key Vault Key.

KeyVaultId string

The ID of the Key Vault. Changing this forces a new resource to be created.

KeyVersion string

The version of Key Vault Key.

UserIdentity string

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

ClusterId string

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

KeyName string

The name of Key Vault Key.

KeyVaultId string

The ID of the Key Vault. Changing this forces a new resource to be created.

KeyVersion string

The version of Key Vault Key.

UserIdentity string

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

clusterId String

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

keyName String

The name of Key Vault Key.

keyVaultId String

The ID of the Key Vault. Changing this forces a new resource to be created.

keyVersion String

The version of Key Vault Key.

userIdentity String

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

clusterId string

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

keyName string

The name of Key Vault Key.

keyVaultId string

The ID of the Key Vault. Changing this forces a new resource to be created.

keyVersion string

The version of Key Vault Key.

userIdentity string

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

cluster_id str

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

key_name str

The name of Key Vault Key.

key_vault_id str

The ID of the Key Vault. Changing this forces a new resource to be created.

key_version str

The version of Key Vault Key.

user_identity str

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

clusterId String

The ID of the Kusto Cluster. Changing this forces a new resource to be created.

keyName String

The name of Key Vault Key.

keyVaultId String

The ID of the Key Vault. Changing this forces a new resource to be created.

keyVersion String

The version of Key Vault Key.

userIdentity String

The user assigned identity that has access to the Key Vault Key. If not specified, system assigned identity will be used.

Import

Customer Managed Keys for a Kusto Cluster can be imported using the resource id, e.g.

 $ pulumi import azure:kusto/clusterCustomerManagedKey:ClusterCustomerManagedKey example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Kusto/Clusters/cluster1

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.