Key
Provides a KMS customer master key.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var key = new Aws.Kms.Key("key", new Aws.Kms.KeyArgs
{
DeletionWindowInDays = 10,
Description = "KMS key 1",
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/kms"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kms.NewKey(ctx, "key", &kms.KeyArgs{
DeletionWindowInDays: pulumi.Int(10),
Description: pulumi.String("KMS key 1"),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
key = aws.kms.Key("key",
deletion_window_in_days=10,
description="KMS key 1")import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const key = new aws.kms.Key("a", {
deletionWindowInDays: 10,
description: "KMS key 1",
});Create a Key Resource
new Key(name: string, args?: KeyArgs, opts?: CustomResourceOptions);def Key(resource_name, opts=None, customer_master_key_spec=None, deletion_window_in_days=None, description=None, enable_key_rotation=None, is_enabled=None, key_usage=None, policy=None, tags=None, __props__=None);public Key(string name, KeyArgs? args = null, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Key Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Key resource accepts the following input properties:
- Customer
Master stringKey Spec 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,ECC_NIST_P256,ECC_NIST_P384,ECC_NIST_P521, orECC_SECG_P256K1. Defaults toSYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.- Deletion
Window intIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- Description string
The description of the key as viewed in AWS console.
- Enable
Key boolRotation Specifies whether key rotation is enabled. Defaults to false.
- Is
Enabled bool Specifies whether the key is enabled. Defaults to true.
- Key
Usage string Specifies the intended use of the key. Valid values:
ENCRYPT_DECRYPTorSIGN_VERIFY. Defaults toENCRYPT_DECRYPT.- Policy string
A valid policy JSON document.
- Dictionary<string, string>
A map of tags to assign to the object.
- Customer
Master stringKey Spec 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,ECC_NIST_P256,ECC_NIST_P384,ECC_NIST_P521, orECC_SECG_P256K1. Defaults toSYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.- Deletion
Window intIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- Description string
The description of the key as viewed in AWS console.
- Enable
Key boolRotation Specifies whether key rotation is enabled. Defaults to false.
- Is
Enabled bool Specifies whether the key is enabled. Defaults to true.
- Key
Usage string Specifies the intended use of the key. Valid values:
ENCRYPT_DECRYPTorSIGN_VERIFY. Defaults toENCRYPT_DECRYPT.- Policy string
A valid policy JSON document.
- map[string]string
A map of tags to assign to the object.
- customer
Master stringKey Spec 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,ECC_NIST_P256,ECC_NIST_P384,ECC_NIST_P521, orECC_SECG_P256K1. Defaults toSYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.- deletion
Window numberIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- description string
The description of the key as viewed in AWS console.
- enable
Key booleanRotation Specifies whether key rotation is enabled. Defaults to false.
- is
Enabled boolean Specifies whether the key is enabled. Defaults to true.
- key
Usage string Specifies the intended use of the key. Valid values:
ENCRYPT_DECRYPTorSIGN_VERIFY. Defaults toENCRYPT_DECRYPT.- policy string
A valid policy JSON document.
- {[key: string]: string}
A map of tags to assign to the object.
- customer_
master_ strkey_ spec 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,ECC_NIST_P256,ECC_NIST_P384,ECC_NIST_P521, orECC_SECG_P256K1. Defaults toSYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.- deletion_
window_ floatin_ days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- description str
The description of the key as viewed in AWS console.
- enable_
key_ boolrotation Specifies whether key rotation is enabled. Defaults to false.
- is_
enabled bool Specifies whether the key is enabled. Defaults to true.
- key_
usage str Specifies the intended use of the key. Valid values:
ENCRYPT_DECRYPTorSIGN_VERIFY. Defaults toENCRYPT_DECRYPT.- policy str
A valid policy JSON document.
- Dict[str, str]
A map of tags to assign to the object.
Outputs
All input properties are implicitly available as output properties. Additionally, the Key resource produces the following output properties:
Look up an Existing Key Resource
Get an existing Key resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: KeyState, opts?: CustomResourceOptions): Keystatic get(resource_name, id, opts=None, arn=None, customer_master_key_spec=None, deletion_window_in_days=None, description=None, enable_key_rotation=None, is_enabled=None, key_id=None, key_usage=None, policy=None, tags=None, __props__=None);public static Key Get(string name, Input<string> id, KeyState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Arn string
The Amazon Resource Name (ARN) of the key.
- Customer
Master stringKey Spec 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,ECC_NIST_P256,ECC_NIST_P384,ECC_NIST_P521, orECC_SECG_P256K1. Defaults toSYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.- Deletion
Window intIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- Description string
The description of the key as viewed in AWS console.
- Enable
Key boolRotation Specifies whether key rotation is enabled. Defaults to false.
- Is
Enabled bool Specifies whether the key is enabled. Defaults to true.
- Key
Id string The globally unique identifier for the key.
- Key
Usage string Specifies the intended use of the key. Valid values:
ENCRYPT_DECRYPTorSIGN_VERIFY. Defaults toENCRYPT_DECRYPT.- Policy string
A valid policy JSON document.
- Dictionary<string, string>
A map of tags to assign to the object.
- Arn string
The Amazon Resource Name (ARN) of the key.
- Customer
Master stringKey Spec 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,ECC_NIST_P256,ECC_NIST_P384,ECC_NIST_P521, orECC_SECG_P256K1. Defaults toSYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.- Deletion
Window intIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- Description string
The description of the key as viewed in AWS console.
- Enable
Key boolRotation Specifies whether key rotation is enabled. Defaults to false.
- Is
Enabled bool Specifies whether the key is enabled. Defaults to true.
- Key
Id string The globally unique identifier for the key.
- Key
Usage string Specifies the intended use of the key. Valid values:
ENCRYPT_DECRYPTorSIGN_VERIFY. Defaults toENCRYPT_DECRYPT.- Policy string
A valid policy JSON document.
- map[string]string
A map of tags to assign to the object.
- arn string
The Amazon Resource Name (ARN) of the key.
- customer
Master stringKey Spec 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,ECC_NIST_P256,ECC_NIST_P384,ECC_NIST_P521, orECC_SECG_P256K1. Defaults toSYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.- deletion
Window numberIn Days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- description string
The description of the key as viewed in AWS console.
- enable
Key booleanRotation Specifies whether key rotation is enabled. Defaults to false.
- is
Enabled boolean Specifies whether the key is enabled. Defaults to true.
- key
Id string The globally unique identifier for the key.
- key
Usage string Specifies the intended use of the key. Valid values:
ENCRYPT_DECRYPTorSIGN_VERIFY. Defaults toENCRYPT_DECRYPT.- policy string
A valid policy JSON document.
- {[key: string]: string}
A map of tags to assign to the object.
- arn str
The Amazon Resource Name (ARN) of the key.
- customer_
master_ strkey_ spec 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,ECC_NIST_P256,ECC_NIST_P384,ECC_NIST_P521, orECC_SECG_P256K1. Defaults toSYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.- deletion_
window_ floatin_ days Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days.
- description str
The description of the key as viewed in AWS console.
- enable_
key_ boolrotation Specifies whether key rotation is enabled. Defaults to false.
- is_
enabled bool Specifies whether the key is enabled. Defaults to true.
- key_
id str The globally unique identifier for the key.
- key_
usage str Specifies the intended use of the key. Valid values:
ENCRYPT_DECRYPTorSIGN_VERIFY. Defaults toENCRYPT_DECRYPT.- policy str
A valid policy JSON document.
- Dict[str, str]
A map of tags to assign to the object.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.