Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.15.0 published on Wednesday, Aug 17, 2022 by Pulumi

AccountCustomerManagedKey

Manages a Customer Managed Key for a Cognitive Services Account.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var current = Azure.Core.GetClientConfig.Invoke();

    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West US",
    });

    var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
    });

    var exampleAccount = new Azure.Cognitive.Account("exampleAccount", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        Kind = "Face",
        SkuName = "E0",
        CustomSubdomainName = "example-account",
        Identity = new Azure.Cognitive.Inputs.AccountIdentityArgs
        {
            Type = "SystemAssigned, UserAssigned",
            IdentityIds = new[]
            {
                exampleUserAssignedIdentity.Id,
            },
        },
    });

    var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
        SkuName = "standard",
        PurgeProtectionEnabled = true,
        AccessPolicies = new[]
        {
            new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs
            {
                TenantId = exampleAccount.Identity.Apply(identity => identity?.TenantId),
                ObjectId = exampleAccount.Identity.Apply(identity => identity?.PrincipalId),
                KeyPermissions = new[]
                {
                    "Get",
                    "Create",
                    "List",
                    "Restore",
                    "Recover",
                    "UnwrapKey",
                    "WrapKey",
                    "Purge",
                    "Encrypt",
                    "Decrypt",
                    "Sign",
                    "Verify",
                },
                SecretPermissions = new[]
                {
                    "Get",
                },
            },
            new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs
            {
                TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
                ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId),
                KeyPermissions = new[]
                {
                    "Get",
                    "Create",
                    "Delete",
                    "List",
                    "Restore",
                    "Recover",
                    "UnwrapKey",
                    "WrapKey",
                    "Purge",
                    "Encrypt",
                    "Decrypt",
                    "Sign",
                    "Verify",
                },
                SecretPermissions = new[]
                {
                    "Get",
                },
            },
            new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs
            {
                TenantId = exampleUserAssignedIdentity.TenantId,
                ObjectId = exampleUserAssignedIdentity.PrincipalId,
                KeyPermissions = new[]
                {
                    "Get",
                    "Create",
                    "Delete",
                    "List",
                    "Restore",
                    "Recover",
                    "UnwrapKey",
                    "WrapKey",
                    "Purge",
                    "Encrypt",
                    "Decrypt",
                    "Sign",
                    "Verify",
                },
                SecretPermissions = new[]
                {
                    "Get",
                },
            },
        },
    });

    var exampleKey = new Azure.KeyVault.Key("exampleKey", new()
    {
        KeyVaultId = exampleKeyVault.Id,
        KeyType = "RSA",
        KeySize = 2048,
        KeyOpts = new[]
        {
            "decrypt",
            "encrypt",
            "sign",
            "unwrapKey",
            "verify",
            "wrapKey",
        },
    });

    var exampleAccountCustomerManagedKey = new Azure.Cognitive.AccountCustomerManagedKey("exampleAccountCustomerManagedKey", new()
    {
        CognitiveAccountId = exampleAccount.Id,
        KeyVaultKeyId = exampleKey.Id,
        IdentityClientId = exampleUserAssignedIdentity.ClientId,
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cognitive"
	"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
		}
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West US"),
		})
		if err != nil {
			return err
		}
		exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
		})
		if err != nil {
			return err
		}
		exampleAccount, err := cognitive.NewAccount(ctx, "exampleAccount", &cognitive.AccountArgs{
			Location:            exampleResourceGroup.Location,
			ResourceGroupName:   exampleResourceGroup.Name,
			Kind:                pulumi.String("Face"),
			SkuName:             pulumi.String("E0"),
			CustomSubdomainName: pulumi.String("example-account"),
			Identity: &cognitive.AccountIdentityArgs{
				Type: pulumi.String("SystemAssigned, UserAssigned"),
				IdentityIds: pulumi.StringArray{
					exampleUserAssignedIdentity.ID(),
				},
			},
		})
		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),
			AccessPolicies: keyvault.KeyVaultAccessPolicyArray{
				&keyvault.KeyVaultAccessPolicyArgs{
					TenantId: exampleAccount.Identity.ApplyT(func(identity cognitive.AccountIdentity) (string, error) {
						return identity.TenantId, nil
					}).(pulumi.StringOutput),
					ObjectId: exampleAccount.Identity.ApplyT(func(identity cognitive.AccountIdentity) (string, error) {
						return identity.PrincipalId, nil
					}).(pulumi.StringOutput),
					KeyPermissions: pulumi.StringArray{
						pulumi.String("Get"),
						pulumi.String("Create"),
						pulumi.String("List"),
						pulumi.String("Restore"),
						pulumi.String("Recover"),
						pulumi.String("UnwrapKey"),
						pulumi.String("WrapKey"),
						pulumi.String("Purge"),
						pulumi.String("Encrypt"),
						pulumi.String("Decrypt"),
						pulumi.String("Sign"),
						pulumi.String("Verify"),
					},
					SecretPermissions: pulumi.StringArray{
						pulumi.String("Get"),
					},
				},
				&keyvault.KeyVaultAccessPolicyArgs{
					TenantId: pulumi.String(current.TenantId),
					ObjectId: pulumi.String(current.ObjectId),
					KeyPermissions: pulumi.StringArray{
						pulumi.String("Get"),
						pulumi.String("Create"),
						pulumi.String("Delete"),
						pulumi.String("List"),
						pulumi.String("Restore"),
						pulumi.String("Recover"),
						pulumi.String("UnwrapKey"),
						pulumi.String("WrapKey"),
						pulumi.String("Purge"),
						pulumi.String("Encrypt"),
						pulumi.String("Decrypt"),
						pulumi.String("Sign"),
						pulumi.String("Verify"),
					},
					SecretPermissions: pulumi.StringArray{
						pulumi.String("Get"),
					},
				},
				&keyvault.KeyVaultAccessPolicyArgs{
					TenantId: exampleUserAssignedIdentity.TenantId,
					ObjectId: exampleUserAssignedIdentity.PrincipalId,
					KeyPermissions: pulumi.StringArray{
						pulumi.String("Get"),
						pulumi.String("Create"),
						pulumi.String("Delete"),
						pulumi.String("List"),
						pulumi.String("Restore"),
						pulumi.String("Recover"),
						pulumi.String("UnwrapKey"),
						pulumi.String("WrapKey"),
						pulumi.String("Purge"),
						pulumi.String("Encrypt"),
						pulumi.String("Decrypt"),
						pulumi.String("Sign"),
						pulumi.String("Verify"),
					},
					SecretPermissions: pulumi.StringArray{
						pulumi.String("Get"),
					},
				},
			},
		})
		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"),
			},
		})
		if err != nil {
			return err
		}
		_, err = cognitive.NewAccountCustomerManagedKey(ctx, "exampleAccountCustomerManagedKey", &cognitive.AccountCustomerManagedKeyArgs{
			CognitiveAccountId: exampleAccount.ID(),
			KeyVaultKeyId:      exampleKey.ID(),
			IdentityClientId:   exampleUserAssignedIdentity.ClientId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.authorization.UserAssignedIdentity;
import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
import com.pulumi.azure.cognitive.Account;
import com.pulumi.azure.cognitive.AccountArgs;
import com.pulumi.azure.cognitive.inputs.AccountIdentityArgs;
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.cognitive.AccountCustomerManagedKey;
import com.pulumi.azure.cognitive.AccountCustomerManagedKeyArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West US")
            .build());

        var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .build());

        var exampleAccount = new Account("exampleAccount", AccountArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .kind("Face")
            .skuName("E0")
            .customSubdomainName("example-account")
            .identity(AccountIdentityArgs.builder()
                .type("SystemAssigned, UserAssigned")
                .identityIds(exampleUserAssignedIdentity.id())
                .build())
            .build());

        var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
            .skuName("standard")
            .purgeProtectionEnabled(true)
            .accessPolicies(            
                KeyVaultAccessPolicyArgs.builder()
                    .tenantId(exampleAccount.identity().applyValue(identity -> identity.tenantId()))
                    .objectId(exampleAccount.identity().applyValue(identity -> identity.principalId()))
                    .keyPermissions(                    
                        "Get",
                        "Create",
                        "List",
                        "Restore",
                        "Recover",
                        "UnwrapKey",
                        "WrapKey",
                        "Purge",
                        "Encrypt",
                        "Decrypt",
                        "Sign",
                        "Verify")
                    .secretPermissions("Get")
                    .build(),
                KeyVaultAccessPolicyArgs.builder()
                    .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
                    .objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
                    .keyPermissions(                    
                        "Get",
                        "Create",
                        "Delete",
                        "List",
                        "Restore",
                        "Recover",
                        "UnwrapKey",
                        "WrapKey",
                        "Purge",
                        "Encrypt",
                        "Decrypt",
                        "Sign",
                        "Verify")
                    .secretPermissions("Get")
                    .build(),
                KeyVaultAccessPolicyArgs.builder()
                    .tenantId(exampleUserAssignedIdentity.tenantId())
                    .objectId(exampleUserAssignedIdentity.principalId())
                    .keyPermissions(                    
                        "Get",
                        "Create",
                        "Delete",
                        "List",
                        "Restore",
                        "Recover",
                        "UnwrapKey",
                        "WrapKey",
                        "Purge",
                        "Encrypt",
                        "Decrypt",
                        "Sign",
                        "Verify")
                    .secretPermissions("Get")
                    .build())
            .build());

        var exampleKey = new Key("exampleKey", KeyArgs.builder()        
            .keyVaultId(exampleKeyVault.id())
            .keyType("RSA")
            .keySize(2048)
            .keyOpts(            
                "decrypt",
                "encrypt",
                "sign",
                "unwrapKey",
                "verify",
                "wrapKey")
            .build());

        var exampleAccountCustomerManagedKey = new AccountCustomerManagedKey("exampleAccountCustomerManagedKey", AccountCustomerManagedKeyArgs.builder()        
            .cognitiveAccountId(exampleAccount.id())
            .keyVaultKeyId(exampleKey.id())
            .identityClientId(exampleUserAssignedIdentity.clientId())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

current = azure.core.get_client_config()
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US")
example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location)
example_account = azure.cognitive.Account("exampleAccount",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    kind="Face",
    sku_name="E0",
    custom_subdomain_name="example-account",
    identity=azure.cognitive.AccountIdentityArgs(
        type="SystemAssigned, UserAssigned",
        identity_ids=[example_user_assigned_identity.id],
    ))
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,
    access_policies=[
        azure.keyvault.KeyVaultAccessPolicyArgs(
            tenant_id=example_account.identity.tenant_id,
            object_id=example_account.identity.principal_id,
            key_permissions=[
                "Get",
                "Create",
                "List",
                "Restore",
                "Recover",
                "UnwrapKey",
                "WrapKey",
                "Purge",
                "Encrypt",
                "Decrypt",
                "Sign",
                "Verify",
            ],
            secret_permissions=["Get"],
        ),
        azure.keyvault.KeyVaultAccessPolicyArgs(
            tenant_id=current.tenant_id,
            object_id=current.object_id,
            key_permissions=[
                "Get",
                "Create",
                "Delete",
                "List",
                "Restore",
                "Recover",
                "UnwrapKey",
                "WrapKey",
                "Purge",
                "Encrypt",
                "Decrypt",
                "Sign",
                "Verify",
            ],
            secret_permissions=["Get"],
        ),
        azure.keyvault.KeyVaultAccessPolicyArgs(
            tenant_id=example_user_assigned_identity.tenant_id,
            object_id=example_user_assigned_identity.principal_id,
            key_permissions=[
                "Get",
                "Create",
                "Delete",
                "List",
                "Restore",
                "Recover",
                "UnwrapKey",
                "WrapKey",
                "Purge",
                "Encrypt",
                "Decrypt",
                "Sign",
                "Verify",
            ],
            secret_permissions=["Get"],
        ),
    ])
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",
    ])
example_account_customer_managed_key = azure.cognitive.AccountCustomerManagedKey("exampleAccountCustomerManagedKey",
    cognitive_account_id=example_account.id,
    key_vault_key_id=example_key.id,
    identity_client_id=example_user_assigned_identity.client_id)
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 US"});
const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
});
const exampleAccount = new azure.cognitive.Account("exampleAccount", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    kind: "Face",
    skuName: "E0",
    customSubdomainName: "example-account",
    identity: {
        type: "SystemAssigned, UserAssigned",
        identityIds: [exampleUserAssignedIdentity.id],
    },
});
const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    tenantId: current.then(current => current.tenantId),
    skuName: "standard",
    purgeProtectionEnabled: true,
    accessPolicies: [
        {
            tenantId: exampleAccount.identity.apply(identity => identity?.tenantId),
            objectId: exampleAccount.identity.apply(identity => identity?.principalId),
            keyPermissions: [
                "Get",
                "Create",
                "List",
                "Restore",
                "Recover",
                "UnwrapKey",
                "WrapKey",
                "Purge",
                "Encrypt",
                "Decrypt",
                "Sign",
                "Verify",
            ],
            secretPermissions: ["Get"],
        },
        {
            tenantId: current.then(current => current.tenantId),
            objectId: current.then(current => current.objectId),
            keyPermissions: [
                "Get",
                "Create",
                "Delete",
                "List",
                "Restore",
                "Recover",
                "UnwrapKey",
                "WrapKey",
                "Purge",
                "Encrypt",
                "Decrypt",
                "Sign",
                "Verify",
            ],
            secretPermissions: ["Get"],
        },
        {
            tenantId: exampleUserAssignedIdentity.tenantId,
            objectId: exampleUserAssignedIdentity.principalId,
            keyPermissions: [
                "Get",
                "Create",
                "Delete",
                "List",
                "Restore",
                "Recover",
                "UnwrapKey",
                "WrapKey",
                "Purge",
                "Encrypt",
                "Decrypt",
                "Sign",
                "Verify",
            ],
            secretPermissions: ["Get"],
        },
    ],
});
const exampleKey = new azure.keyvault.Key("exampleKey", {
    keyVaultId: exampleKeyVault.id,
    keyType: "RSA",
    keySize: 2048,
    keyOpts: [
        "decrypt",
        "encrypt",
        "sign",
        "unwrapKey",
        "verify",
        "wrapKey",
    ],
});
const exampleAccountCustomerManagedKey = new azure.cognitive.AccountCustomerManagedKey("exampleAccountCustomerManagedKey", {
    cognitiveAccountId: exampleAccount.id,
    keyVaultKeyId: exampleKey.id,
    identityClientId: exampleUserAssignedIdentity.clientId,
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West US
  exampleUserAssignedIdentity:
    type: azure:authorization:UserAssignedIdentity
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
  exampleAccount:
    type: azure:cognitive:Account
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      kind: Face
      skuName: E0
      customSubdomainName: example-account
      identity:
        type: SystemAssigned, UserAssigned
        identityIds:
          - ${exampleUserAssignedIdentity.id}
  exampleKeyVault:
    type: azure:keyvault:KeyVault
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      tenantId: ${current.tenantId}
      skuName: standard
      purgeProtectionEnabled: true
      accessPolicies:
        - tenantId: ${exampleAccount.identity.tenantId}
          objectId: ${exampleAccount.identity.principalId}
          keyPermissions:
            - Get
            - Create
            - List
            - Restore
            - Recover
            - UnwrapKey
            - WrapKey
            - Purge
            - Encrypt
            - Decrypt
            - Sign
            - Verify
          secretPermissions:
            - Get
        - tenantId: ${current.tenantId}
          objectId: ${current.objectId}
          keyPermissions:
            - Get
            - Create
            - Delete
            - List
            - Restore
            - Recover
            - UnwrapKey
            - WrapKey
            - Purge
            - Encrypt
            - Decrypt
            - Sign
            - Verify
          secretPermissions:
            - Get
        - tenantId: ${exampleUserAssignedIdentity.tenantId}
          objectId: ${exampleUserAssignedIdentity.principalId}
          keyPermissions:
            - Get
            - Create
            - Delete
            - List
            - Restore
            - Recover
            - UnwrapKey
            - WrapKey
            - Purge
            - Encrypt
            - Decrypt
            - Sign
            - Verify
          secretPermissions:
            - Get
  exampleKey:
    type: azure:keyvault:Key
    properties:
      keyVaultId: ${exampleKeyVault.id}
      keyType: RSA
      keySize: 2048
      keyOpts:
        - decrypt
        - encrypt
        - sign
        - unwrapKey
        - verify
        - wrapKey
  exampleAccountCustomerManagedKey:
    type: azure:cognitive:AccountCustomerManagedKey
    properties:
      cognitiveAccountId: ${exampleAccount.id}
      keyVaultKeyId: ${exampleKey.id}
      identityClientId: ${exampleUserAssignedIdentity.clientId}
variables:
  current:
    Fn::Invoke:
      Function: azure:core:getClientConfig
      Arguments: {}

Create a AccountCustomerManagedKey Resource

new AccountCustomerManagedKey(name: string, args: AccountCustomerManagedKeyArgs, opts?: CustomResourceOptions);
@overload
def AccountCustomerManagedKey(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              cognitive_account_id: Optional[str] = None,
                              identity_client_id: Optional[str] = None,
                              key_vault_key_id: Optional[str] = None)
@overload
def AccountCustomerManagedKey(resource_name: str,
                              args: AccountCustomerManagedKeyArgs,
                              opts: Optional[ResourceOptions] = None)
func NewAccountCustomerManagedKey(ctx *Context, name string, args AccountCustomerManagedKeyArgs, opts ...ResourceOption) (*AccountCustomerManagedKey, error)
public AccountCustomerManagedKey(string name, AccountCustomerManagedKeyArgs args, CustomResourceOptions? opts = null)
public AccountCustomerManagedKey(String name, AccountCustomerManagedKeyArgs args)
public AccountCustomerManagedKey(String name, AccountCustomerManagedKeyArgs args, CustomResourceOptions options)
type: azure:cognitive:AccountCustomerManagedKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AccountCustomerManagedKeyArgs
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 AccountCustomerManagedKeyArgs
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 AccountCustomerManagedKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AccountCustomerManagedKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AccountCustomerManagedKeyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AccountCustomerManagedKey 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 AccountCustomerManagedKey resource accepts the following input properties:

CognitiveAccountId string

The ID of the Cognitive Account. Changing this forces a new resource to be created.

KeyVaultKeyId string

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

IdentityClientId string

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

CognitiveAccountId string

The ID of the Cognitive Account. Changing this forces a new resource to be created.

KeyVaultKeyId string

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

IdentityClientId string

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

cognitiveAccountId String

The ID of the Cognitive Account. Changing this forces a new resource to be created.

keyVaultKeyId String

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

identityClientId String

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

cognitiveAccountId string

The ID of the Cognitive Account. Changing this forces a new resource to be created.

keyVaultKeyId string

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

identityClientId string

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

cognitive_account_id str

The ID of the Cognitive Account. Changing this forces a new resource to be created.

key_vault_key_id str

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

identity_client_id str

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

cognitiveAccountId String

The ID of the Cognitive Account. Changing this forces a new resource to be created.

keyVaultKeyId String

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

identityClientId String

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

Outputs

All input properties are implicitly available as output properties. Additionally, the AccountCustomerManagedKey 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 AccountCustomerManagedKey Resource

Get an existing AccountCustomerManagedKey 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?: AccountCustomerManagedKeyState, opts?: CustomResourceOptions): AccountCustomerManagedKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cognitive_account_id: Optional[str] = None,
        identity_client_id: Optional[str] = None,
        key_vault_key_id: Optional[str] = None) -> AccountCustomerManagedKey
func GetAccountCustomerManagedKey(ctx *Context, name string, id IDInput, state *AccountCustomerManagedKeyState, opts ...ResourceOption) (*AccountCustomerManagedKey, error)
public static AccountCustomerManagedKey Get(string name, Input<string> id, AccountCustomerManagedKeyState? state, CustomResourceOptions? opts = null)
public static AccountCustomerManagedKey get(String name, Output<String> id, AccountCustomerManagedKeyState 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:
CognitiveAccountId string

The ID of the Cognitive Account. Changing this forces a new resource to be created.

IdentityClientId string

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

KeyVaultKeyId string

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

CognitiveAccountId string

The ID of the Cognitive Account. Changing this forces a new resource to be created.

IdentityClientId string

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

KeyVaultKeyId string

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

cognitiveAccountId String

The ID of the Cognitive Account. Changing this forces a new resource to be created.

identityClientId String

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

keyVaultKeyId String

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

cognitiveAccountId string

The ID of the Cognitive Account. Changing this forces a new resource to be created.

identityClientId string

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

keyVaultKeyId string

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

cognitive_account_id str

The ID of the Cognitive Account. Changing this forces a new resource to be created.

identity_client_id str

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

key_vault_key_id str

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

cognitiveAccountId String

The ID of the Cognitive Account. Changing this forces a new resource to be created.

identityClientId String

The Client ID of the User Assigned Identity that has access to the key. This property only needs to be specified when there're multiple identities attached to the Cognitive Account.

keyVaultKeyId String

The ID of the Key Vault Key which should be used to Encrypt the data in this Cognitive Account.

Import

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

 $ pulumi import azure:cognitive/accountCustomerManagedKey:AccountCustomerManagedKey example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.CognitiveServices/accounts/account1

Package Details

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

This Pulumi package is based on the azurerm Terraform Provider.