KeyArgs

data class KeyArgs(val keyName: Output<String>? = null, val properties: Output<KeyPropertiesArgs>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val vaultName: Output<String>? = null) : ConvertibleToJava<KeyArgs>

The key resource. Uses Azure REST API version 2024-11-01. In version 2.x of the Azure Native provider, it used API version 2023-02-01. Other available API versions: 2023-02-01, 2023-07-01, 2024-04-01-preview, 2024-12-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native keyvault [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create a key

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var key = new AzureNative.KeyVault.Key("key", new()
{
KeyName = "sample-key-name",
Properties = new AzureNative.KeyVault.Inputs.KeyPropertiesArgs
{
Kty = AzureNative.KeyVault.JsonWebKeyType.RSA,
},
ResourceGroupName = "sample-group",
VaultName = "sample-vault-name",
});
});
package main
import (
keyvault "github.com/pulumi/pulumi-azure-native-sdk/keyvault/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := keyvault.NewKey(ctx, "key", &keyvault.KeyArgs{
KeyName: pulumi.String("sample-key-name"),
Properties: &keyvault.KeyPropertiesArgs{
Kty: pulumi.String(keyvault.JsonWebKeyTypeRSA),
},
ResourceGroupName: pulumi.String("sample-group"),
VaultName: pulumi.String("sample-vault-name"),
})
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.azurenative.keyvault.Key;
import com.pulumi.azurenative.keyvault.KeyArgs;
import com.pulumi.azurenative.keyvault.inputs.KeyPropertiesArgs;
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) {
var key = new Key("key", KeyArgs.builder()
.keyName("sample-key-name")
.properties(KeyPropertiesArgs.builder()
.kty("RSA")
.build())
.resourceGroupName("sample-group")
.vaultName("sample-vault-name")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:keyvault:Key sample-key-name /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}

Constructors

Link copied to clipboard
constructor(keyName: Output<String>? = null, properties: Output<KeyPropertiesArgs>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, vaultName: Output<String>? = null)

Properties

Link copied to clipboard
val keyName: Output<String>? = null

The name of the key to be created. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.

Link copied to clipboard
val properties: Output<KeyPropertiesArgs>? = null

The properties of the key to be created.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group which contains the specified key vault.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

The tags that will be assigned to the key.

Link copied to clipboard
val vaultName: Output<String>? = null

The name of the key vault which contains the key to be created.

Functions

Link copied to clipboard
open override fun toJava(): KeyArgs