Key

class Key : KotlinCustomResource

Manages a single-Region or multi-Region primary KMS key.

NOTE on KMS Key Policy: KMS Key Policy can be configured in either the standalone resource aws.kms.KeyPolicy or with the parameter policy in this resource. Configuring with both will cause inconsistencies and may overwrite configuration.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kms.Key;
import com.pulumi.aws.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()
.deletionWindowInDays(10)
.description("KMS key 1")
.build());
}
}

Import

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

$ pulumi import aws:kms/key:Key a 1234abcd-12ab-34cd-56ef-1234567890ab

Properties

Link copied to clipboard
val arn: Output<String>

The Amazon Resource Name (ARN) of the key.

Link copied to clipboard

A flag to indicate whether to bypass the key policy lockout safety check. Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately. For more information, refer to the scenario in the Default Key Policy section in the AWS Key Management Service Developer Guide. The default value is false.

Link copied to clipboard

Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. Valid values: SYMMETRIC_DEFAULT, RSA_2048, RSA_3072, RSA_4096, HMAC_256, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, or ECC_SECG_P256K1. Defaults to SYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.

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

ID of the KMS Custom Key Store where the key will be stored instead of KMS (eg CloudHSM).

Link copied to clipboard

The waiting period, specified in number of days. After the waiting period ends, AWS KMS deletes the KMS key. If you specify a value, it must be between 7 and 30, inclusive. If you do not specify a value, it defaults to 30. If the KMS key is a multi-Region primary key with replicas, the waiting period begins when the last of its replica keys is deleted. Otherwise, the waiting period begins immediately.

Link copied to clipboard
val description: Output<String>

The description of the key as viewed in AWS console.

Link copied to clipboard

Specifies whether key rotation is enabled. Defaults to false.

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

Specifies whether the key is enabled. Defaults to true.

Link copied to clipboard
val keyId: Output<String>

The globally unique identifier for the key.

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

Specifies the intended use of the key. Valid values: ENCRYPT_DECRYPT, SIGN_VERIFY, or GENERATE_VERIFY_MAC. Defaults to ENCRYPT_DECRYPT.

Link copied to clipboard
val multiRegion: Output<Boolean>

Indicates whether the KMS key is a multi-Region (true) or regional (false) key. Defaults to false.

Link copied to clipboard
val policy: Output<String>

A valid policy JSON document. Although this is a key policy, not an IAM policy, an aws.iam.getPolicyDocument, in the form that designates a principal, can be used.

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

A map of tags to assign to the object. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

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

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>