import * as pulumi from "@pulumi/pulumi"; /** * Manages an Azure App Configuration Key. * * > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). * * ## Example Usage * * ### `Kv` Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "example-resources", * location: "West Europe", * }); * const appconf = new azure.appconfiguration.ConfigurationStore("appconf", { * name: "appConf1", * resourceGroupName: example.name, * location: example.location, * }); * const current = azure.core.getClientConfig({}); * const appconfDataowner = new azure.authorization.Assignment("appconf_dataowner", { * scope: appconf.id, * roleDefinitionName: "App Configuration Data Owner", * principalId: current.then(current => current.objectId), * }); * const test = new azure.appconfiguration.ConfigurationKey("test", { * configurationStoreId: appconf.id, * key: "appConfKey1", * label: "somelabel", * value: "a test", * }, { * dependsOn: [appconfDataowner], * }); * ``` * * ### `Vault` Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "example-resources", * location: "West Europe", * }); * const appconf = new azure.appconfiguration.ConfigurationStore("appconf", { * name: "appConf1", * resourceGroupName: example.name, * location: example.location, * }); * const current = azure.core.getClientConfig({}); * const kv = new azure.keyvault.KeyVault("kv", { * name: "kv", * location: testAzurermResourceGroup.location, * resourceGroupName: testAzurermResourceGroup.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", * "Get", * ], * secretPermissions: [ * "Set", * "Get", * "Delete", * "Purge", * "Recover", * ], * }], * }); * const kvs = new azure.keyvault.Secret("kvs", { * name: "kvs", * value: "szechuan", * keyVaultId: kv.id, * }); * const appconfDataowner = new azure.authorization.Assignment("appconf_dataowner", { * scope: appconf.id, * roleDefinitionName: "App Configuration Data Owner", * principalId: current.then(current => current.objectId), * }); * const test = new azure.appconfiguration.ConfigurationKey("test", { * configurationStoreId: testAzurermAppConfiguration.id, * key: "key1", * type: "vault", * label: "label1", * vaultKeyReference: kvs.versionlessId, * }, { * dependsOn: [appconfDataowner], * }); * ``` * * ## Import * * App Configuration Keys can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:appconfiguration/configurationKey:ConfigurationKey test https://appconfname1.azconfig.io/kv/keyName?label=labelName * ``` * * If you wish to import a key with an empty label then simply leave label's name blank: * * ```sh * $ pulumi import azure:appconfiguration/configurationKey:ConfigurationKey test https://appconfname1.azconfig.io/kv/keyName?label= * ``` */ export declare class ConfigurationKey extends pulumi.CustomResource { /** * Get an existing ConfigurationKey resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: ConfigurationKeyState, opts?: pulumi.CustomResourceOptions): ConfigurationKey; /** * Returns true if the given object is an instance of ConfigurationKey. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ConfigurationKey; /** * Specifies the id of the App Configuration. Changing this forces a new resource to be created. */ readonly configurationStoreId: pulumi.Output; /** * The content type of the App Configuration Key. This should only be set when type is set to `kv`. */ readonly contentType: pulumi.Output; /** * (Optional) The ETag of the key. */ readonly etag: pulumi.Output; /** * The name of the App Configuration Key to create. Changing this forces a new resource to be created. */ readonly key: pulumi.Output; /** * The label of the App Configuration Key. Changing this forces a new resource to be created. */ readonly label: pulumi.Output; /** * Should this App Configuration Key be Locked to prevent changes? */ readonly locked: pulumi.Output; /** * A mapping of tags to assign to the resource. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The type of the App Configuration Key. It can either be `kv` (simple [key/value](https://docs.microsoft.com/azure/azure-app-configuration/concept-key-value)) or `vault` (where the value is a reference to a [Key Vault Secret](https://azure.microsoft.com/en-gb/services/key-vault/). Defaults to `kv`. */ readonly type: pulumi.Output; /** * The value of the App Configuration Key. This should only be set when type is set to `kv`. * * > **Note:** `value` and `vaultKeyReference` are mutually exclusive. */ readonly value: pulumi.Output; /** * The ID of the vault secret this App Configuration Key refers to. This should only be set when `type` is set to `vault`. * * > **Note:** `vaultKeyReference` and `value` are mutually exclusive. * * > **Note:** When setting the `vaultKeyReference` using the `id` will pin the value to specific version of the secret, to reference latest secret value use `versionlessId` */ readonly vaultKeyReference: pulumi.Output; /** * Create a ConfigurationKey resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ConfigurationKeyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ConfigurationKey resources. */ export interface ConfigurationKeyState { /** * Specifies the id of the App Configuration. Changing this forces a new resource to be created. */ configurationStoreId?: pulumi.Input; /** * The content type of the App Configuration Key. This should only be set when type is set to `kv`. */ contentType?: pulumi.Input; /** * (Optional) The ETag of the key. */ etag?: pulumi.Input; /** * The name of the App Configuration Key to create. Changing this forces a new resource to be created. */ key?: pulumi.Input; /** * The label of the App Configuration Key. Changing this forces a new resource to be created. */ label?: pulumi.Input; /** * Should this App Configuration Key be Locked to prevent changes? */ locked?: pulumi.Input; /** * A mapping of tags to assign to the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The type of the App Configuration Key. It can either be `kv` (simple [key/value](https://docs.microsoft.com/azure/azure-app-configuration/concept-key-value)) or `vault` (where the value is a reference to a [Key Vault Secret](https://azure.microsoft.com/en-gb/services/key-vault/). Defaults to `kv`. */ type?: pulumi.Input; /** * The value of the App Configuration Key. This should only be set when type is set to `kv`. * * > **Note:** `value` and `vaultKeyReference` are mutually exclusive. */ value?: pulumi.Input; /** * The ID of the vault secret this App Configuration Key refers to. This should only be set when `type` is set to `vault`. * * > **Note:** `vaultKeyReference` and `value` are mutually exclusive. * * > **Note:** When setting the `vaultKeyReference` using the `id` will pin the value to specific version of the secret, to reference latest secret value use `versionlessId` */ vaultKeyReference?: pulumi.Input; } /** * The set of arguments for constructing a ConfigurationKey resource. */ export interface ConfigurationKeyArgs { /** * Specifies the id of the App Configuration. Changing this forces a new resource to be created. */ configurationStoreId: pulumi.Input; /** * The content type of the App Configuration Key. This should only be set when type is set to `kv`. */ contentType?: pulumi.Input; /** * (Optional) The ETag of the key. */ etag?: pulumi.Input; /** * The name of the App Configuration Key to create. Changing this forces a new resource to be created. */ key: pulumi.Input; /** * The label of the App Configuration Key. Changing this forces a new resource to be created. */ label?: pulumi.Input; /** * Should this App Configuration Key be Locked to prevent changes? */ locked?: pulumi.Input; /** * A mapping of tags to assign to the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The type of the App Configuration Key. It can either be `kv` (simple [key/value](https://docs.microsoft.com/azure/azure-app-configuration/concept-key-value)) or `vault` (where the value is a reference to a [Key Vault Secret](https://azure.microsoft.com/en-gb/services/key-vault/). Defaults to `kv`. */ type?: pulumi.Input; /** * The value of the App Configuration Key. This should only be set when type is set to `kv`. * * > **Note:** `value` and `vaultKeyReference` are mutually exclusive. */ value?: pulumi.Input; /** * The ID of the vault secret this App Configuration Key refers to. This should only be set when `type` is set to `vault`. * * > **Note:** `vaultKeyReference` and `value` are mutually exclusive. * * > **Note:** When setting the `vaultKeyReference` using the `id` will pin the value to specific version of the secret, to reference latest secret value use `versionlessId` */ vaultKeyReference?: pulumi.Input; }