KeyArgs

data class KeyArgs(val automaticRotation: Output<String>? = null, val deletionProtection: Output<String>? = null, val deletionProtectionDescription: Output<String>? = null, val deletionWindowInDays: Output<Int>? = null, val description: Output<String>? = null, val dkmsInstanceId: Output<String>? = null, val isEnabled: Output<Boolean>? = null, val keySpec: Output<String>? = null, val keyState: Output<String>? = null, val keyUsage: Output<String>? = null, val origin: Output<String>? = null, val pendingWindowInDays: Output<Int>? = null, val policy: Output<String>? = null, val protectionLevel: Output<String>? = null, val rotationInterval: Output<String>? = null, val status: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<KeyArgs>

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>

Constructors

Link copied to clipboard
constructor(automaticRotation: Output<String>? = null, deletionProtection: Output<String>? = null, deletionProtectionDescription: Output<String>? = null, deletionWindowInDays: Output<Int>? = null, description: Output<String>? = null, dkmsInstanceId: Output<String>? = null, isEnabled: Output<Boolean>? = null, keySpec: Output<String>? = null, keyState: Output<String>? = null, keyUsage: Output<String>? = null, origin: Output<String>? = null, pendingWindowInDays: Output<Int>? = null, policy: Output<String>? = null, protectionLevel: Output<String>? = null, rotationInterval: Output<String>? = null, status: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

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

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

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

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
val deletionWindowInDays: Output<Int>? = null

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>? = null

The description of the key.

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

The ID of the KMS instance.

Link copied to clipboard
val isEnabled: Output<Boolean>? = null

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

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

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>? = null

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

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

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

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

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

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

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>? = null

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
val protectionLevel: Output<String>? = null

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

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

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>? = null

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

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

A mapping of tags to assign to the resource.

Functions

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