KeyArgs

data class KeyArgs(val automaticRotation: 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 protectionLevel: Output<String>? = null, val rotationInterval: Output<String>? = null, val status: Output<String>? = null, val tags: Output<Map<String, Any>>? = null) : ConvertibleToJava<KeyArgs>

A kms key can help user to protect data security in the transmission process. For information about Alikms Key and how to use it, see What is Resource Alikms Key.

NOTE: Available since v1.85.0.

Example Usage

Basic Usage

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 key = new Key("key", KeyArgs.builder()
.description("Hello KMS")
.pendingWindowInDays("7")
.status("Enabled")
.build());
}
}

Import

Alikms key can be imported using the id, e.g.

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

Constructors

Link copied to clipboard
fun KeyArgs(automaticRotation: 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, protectionLevel: Output<String>? = null, rotationInterval: Output<String>? = null, status: Output<String>? = null, tags: Output<Map<String, Any>>? = null)

Functions

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

Properties

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

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

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 CMK. The description can be 0 to 8,192 characters in length.

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

The instance ID of the exclusive 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 type of the CMK. 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. Note: The default type of the CMK is Aliyun_AES_256. Only Dedicated KMS supports Aliyun_AES_128 and Aliyun_AES_192.

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 CMK. Default value: ENCRYPT/DECRYPT. Valid values:

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

The source of key material. Default value: Aliyun_KMS. Valid values:

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. Valid values: 7 to 366. Unit: days. NOTE: From version 1.184.0, pending_window_in_days can be set to 366.

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

The protection level of the CMK. Default value: SOFTWARE. Valid values:

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

The interval for automatic key rotation. Specify the value in the integerunit format. 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. The interval can range from 7 days to 730 days. NOTE: It is Required when automatic_rotation = "Enabled"

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

The status of CMK. Default value: Enabled. Valid Values:

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

A mapping of tags to assign to the resource.