Key

class Key : KotlinCustomResource

Provides a KMS Key resource. For information about KMS Key and how to use it, see What is Key.

NOTE: Available since v1.85.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = new alicloud.kms.Key("default", {
description: "Hello KMS",
status: "Enabled",
pendingWindowInDays: 7,
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.kms.Key("default",
description="Hello KMS",
status="Enabled",
pending_window_in_days=7)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = new AliCloud.Kms.Key("default", new()
{
Description = "Hello KMS",
Status = "Enabled",
PendingWindowInDays = 7,
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kms.NewKey(ctx, "default", &kms.KeyArgs{
Description: pulumi.String("Hello KMS"),
Status: pulumi.String("Enabled"),
PendingWindowInDays: pulumi.Int(7),
})
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.alicloud.kms.Key;
import com.pulumi.alicloud.kms.KeyArgs;
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 default_ = new Key("default", KeyArgs.builder()
.description("Hello KMS")
.status("Enabled")
.pendingWindowInDays(7)
.build());
}
}
resources:
default:
type: alicloud:kms:Key
properties:
description: Hello KMS
status: Enabled
pendingWindowInDays: '7'

Import

KMS Key can be imported using the id, e.g.

$ pulumi import alicloud:kms/key:Key example <id>

Properties

Link copied to clipboard
val arn: Output<String>

The ARN of the key.

Link copied to clipboard

Specifies whether to enable automatic key rotation. Default value: Disabled. Valid values: Enabled, Disabled.

Link copied to clipboard
val creationDate: Output<String>

The time when the CMK was created.

Link copied to clipboard
val creator: Output<String>

The creator of the CMK.

Link copied to clipboard
val deleteDate: Output<String>

The time at which the CMK is scheduled for deletion.

Link copied to clipboard

Specifies whether to enable deletion protection. Default value: Disabled. Valid values: Enabled, Disabled.

Link copied to clipboard

The description of deletion protection. NOTE: deletion_protection_description takes effect only if deletion_protection is set to Enabled.

Link copied to clipboard

Field deletion_window_in_days has been deprecated from provider version 1.85.0. New field pending_window_in_days instead.

Link copied to clipboard
val description: Output<String>?

The description of the key.

Link copied to clipboard
val dkmsInstanceId: Output<String>

The ID of the KMS instance.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val isEnabled: Output<Boolean>

Field is_enabled has been deprecated from provider version 1.85.0. New field status instead.

Link copied to clipboard
val keySpec: Output<String>

The specification of the key. Default value: Aliyun_AES_256. Valid values: Aliyun_AES_256, Aliyun_AES_128, Aliyun_AES_192, Aliyun_SM4, RSA_2048, RSA_3072, EC_P256, EC_P256K, EC_SM2.

Link copied to clipboard
val keyState: Output<String>

Field key_state has been deprecated from provider version 1.123.1. New field status instead.

Link copied to clipboard
val keyUsage: Output<String>

The usage of the key. Default value: ENCRYPT/DECRYPT. Valid values:

Link copied to clipboard

The time when the last rotation was performed.

Link copied to clipboard

The time when the key material expires.

Link copied to clipboard

The time when the next rotation will be performed.

Link copied to clipboard
val origin: Output<String>

The key material origin. Default value: Aliyun_KMS. Valid values: Aliyun_KMS, EXTERNAL.

Link copied to clipboard
val pendingWindowInDays: Output<Int>?

The number of days before the CMK is deleted. During this period, the CMK is in the PendingDeletion state. After this period ends, you cannot cancel the deletion. Unit: days. Valid values: 7 to 366. NOTE: From version 1.184.0, pending_window_in_days can be set to 366.

Link copied to clipboard
val policy: Output<String>

The content of the key policy. The value is in the JSON format. The value can be up to 32,768 bytes in length. For more information, see How to use it.

Link copied to clipboard

The ID of the current primary key version of the symmetric CMK.

Link copied to clipboard
val protectionLevel: Output<String>?

The protection level of the key. Default value: SOFTWARE. Valid values: SOFTWARE, HSM.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val rotationInterval: Output<String>?

The period of automatic key rotation. The following units are supported: d (day), h (hour), m (minute), and s (second). For example, you can use either 7d or 604800s to specify a seven-day interval. NOTE: If automatic_rotation is set to Enabled, rotation_interval is required.

Link copied to clipboard
val status: Output<String>

The status of key. Default value: Enabled. Valid values: Enabled, Disabled, PendingDeletion.

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

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>