ExternalKey
Manages a KMS Customer Master Key that uses external key material. To instead manage a KMS Customer Master Key where AWS automatically generates and potentially rotates key material, see the aws.kms.Key resource.
Note: All arguments including the key material will be stored in the raw state as plain-text.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Kms.ExternalKey("example", new Aws.Kms.ExternalKeyArgs
{
Description = "KMS EXTERNAL for AMI encryption",
});
}
}
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.NewExternalKey(ctx, "example", &kms.ExternalKeyArgs{
Description: pulumi.String("KMS EXTERNAL for AMI encryption"),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.kms.ExternalKey("example", description="KMS EXTERNAL for AMI encryption")import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kms.ExternalKey("example", {
description: "KMS EXTERNAL for AMI encryption",
});Create a ExternalKey Resource
new ExternalKey(name: string, args?: ExternalKeyArgs, opts?: CustomResourceOptions);def ExternalKey(resource_name, opts=None, deletion_window_in_days=None, description=None, enabled=None, key_material_base64=None, policy=None, tags=None, valid_to=None, __props__=None);func NewExternalKey(ctx *Context, name string, args *ExternalKeyArgs, opts ...ResourceOption) (*ExternalKey, error)public ExternalKey(string name, ExternalKeyArgs? args = null, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ExternalKeyArgs
- 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 ExternalKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExternalKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ExternalKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ExternalKey resource accepts the following input properties:
- Deletion
Window intIn Days Duration in days after which the key is deleted after destruction of the resource. Must be between
7and30days. Defaults to30.- Description string
Description of the key.
- Enabled bool
Specifies whether the key is enabled. Keys pending import can only be
false. Imported keys default totrueunless expired.- Key
Material stringBase64 Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. The same key material can be reimported, but you cannot import different key material.
- Policy string
A key policy JSON document. If you do not provide a key policy, AWS KMS attaches a default key policy to the CMK.
- Dictionary<string, string>
A key-value map of tags to assign to the key.
- Valid
To string Time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. If not specified, key material does not expire. Valid values: RFC3339 time string (
YYYY-MM-DDTHH:MM:SSZ)
- Deletion
Window intIn Days Duration in days after which the key is deleted after destruction of the resource. Must be between
7and30days. Defaults to30.- Description string
Description of the key.
- Enabled bool
Specifies whether the key is enabled. Keys pending import can only be
false. Imported keys default totrueunless expired.- Key
Material stringBase64 Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. The same key material can be reimported, but you cannot import different key material.
- Policy string
A key policy JSON document. If you do not provide a key policy, AWS KMS attaches a default key policy to the CMK.
- map[string]string
A key-value map of tags to assign to the key.
- Valid
To string Time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. If not specified, key material does not expire. Valid values: RFC3339 time string (
YYYY-MM-DDTHH:MM:SSZ)
- deletion
Window numberIn Days Duration in days after which the key is deleted after destruction of the resource. Must be between
7and30days. Defaults to30.- description string
Description of the key.
- enabled boolean
Specifies whether the key is enabled. Keys pending import can only be
false. Imported keys default totrueunless expired.- key
Material stringBase64 Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. The same key material can be reimported, but you cannot import different key material.
- policy string
A key policy JSON document. If you do not provide a key policy, AWS KMS attaches a default key policy to the CMK.
- {[key: string]: string}
A key-value map of tags to assign to the key.
- valid
To string Time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. If not specified, key material does not expire. Valid values: RFC3339 time string (
YYYY-MM-DDTHH:MM:SSZ)
- deletion_
window_ floatin_ days Duration in days after which the key is deleted after destruction of the resource. Must be between
7and30days. Defaults to30.- description str
Description of the key.
- enabled bool
Specifies whether the key is enabled. Keys pending import can only be
false. Imported keys default totrueunless expired.- key_
material_ strbase64 Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. The same key material can be reimported, but you cannot import different key material.
- policy str
A key policy JSON document. If you do not provide a key policy, AWS KMS attaches a default key policy to the CMK.
- Dict[str, str]
A key-value map of tags to assign to the key.
- valid_
to str Time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. If not specified, key material does not expire. Valid values: RFC3339 time string (
YYYY-MM-DDTHH:MM:SSZ)
Outputs
All input properties are implicitly available as output properties. Additionally, the ExternalKey resource produces the following output properties:
- Arn string
The Amazon Resource Name (ARN) of the key.
- Expiration
Model string Whether the key material expires. Empty when pending key material import, otherwise
KEY_MATERIAL_EXPIRESorKEY_MATERIAL_DOES_NOT_EXPIRE.- Id string
- The provider-assigned unique ID for this managed resource.
- Key
State string The state of the CMK.
- Key
Usage string The cryptographic operations for which you can use the CMK.
- Arn string
The Amazon Resource Name (ARN) of the key.
- Expiration
Model string Whether the key material expires. Empty when pending key material import, otherwise
KEY_MATERIAL_EXPIRESorKEY_MATERIAL_DOES_NOT_EXPIRE.- Id string
- The provider-assigned unique ID for this managed resource.
- Key
State string The state of the CMK.
- Key
Usage string The cryptographic operations for which you can use the CMK.
- arn string
The Amazon Resource Name (ARN) of the key.
- expiration
Model string Whether the key material expires. Empty when pending key material import, otherwise
KEY_MATERIAL_EXPIRESorKEY_MATERIAL_DOES_NOT_EXPIRE.- id string
- The provider-assigned unique ID for this managed resource.
- key
State string The state of the CMK.
- key
Usage string The cryptographic operations for which you can use the CMK.
- arn str
The Amazon Resource Name (ARN) of the key.
- expiration_
model str Whether the key material expires. Empty when pending key material import, otherwise
KEY_MATERIAL_EXPIRESorKEY_MATERIAL_DOES_NOT_EXPIRE.- id str
- The provider-assigned unique ID for this managed resource.
- key_
state str The state of the CMK.
- key_
usage str The cryptographic operations for which you can use the CMK.
Look up an Existing ExternalKey Resource
Get an existing ExternalKey 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?: ExternalKeyState, opts?: CustomResourceOptions): ExternalKeystatic get(resource_name, id, opts=None, arn=None, deletion_window_in_days=None, description=None, enabled=None, expiration_model=None, key_material_base64=None, key_state=None, key_usage=None, policy=None, tags=None, valid_to=None, __props__=None);func GetExternalKey(ctx *Context, name string, id IDInput, state *ExternalKeyState, opts ...ResourceOption) (*ExternalKey, error)public static ExternalKey Get(string name, Input<string> id, ExternalKeyState? 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.
- Deletion
Window intIn Days Duration in days after which the key is deleted after destruction of the resource. Must be between
7and30days. Defaults to30.- Description string
Description of the key.
- Enabled bool
Specifies whether the key is enabled. Keys pending import can only be
false. Imported keys default totrueunless expired.- Expiration
Model string Whether the key material expires. Empty when pending key material import, otherwise
KEY_MATERIAL_EXPIRESorKEY_MATERIAL_DOES_NOT_EXPIRE.- Key
Material stringBase64 Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. The same key material can be reimported, but you cannot import different key material.
- Key
State string The state of the CMK.
- Key
Usage string The cryptographic operations for which you can use the CMK.
- Policy string
A key policy JSON document. If you do not provide a key policy, AWS KMS attaches a default key policy to the CMK.
- Dictionary<string, string>
A key-value map of tags to assign to the key.
- Valid
To string Time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. If not specified, key material does not expire. Valid values: RFC3339 time string (
YYYY-MM-DDTHH:MM:SSZ)
- Arn string
The Amazon Resource Name (ARN) of the key.
- Deletion
Window intIn Days Duration in days after which the key is deleted after destruction of the resource. Must be between
7and30days. Defaults to30.- Description string
Description of the key.
- Enabled bool
Specifies whether the key is enabled. Keys pending import can only be
false. Imported keys default totrueunless expired.- Expiration
Model string Whether the key material expires. Empty when pending key material import, otherwise
KEY_MATERIAL_EXPIRESorKEY_MATERIAL_DOES_NOT_EXPIRE.- Key
Material stringBase64 Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. The same key material can be reimported, but you cannot import different key material.
- Key
State string The state of the CMK.
- Key
Usage string The cryptographic operations for which you can use the CMK.
- Policy string
A key policy JSON document. If you do not provide a key policy, AWS KMS attaches a default key policy to the CMK.
- map[string]string
A key-value map of tags to assign to the key.
- Valid
To string Time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. If not specified, key material does not expire. Valid values: RFC3339 time string (
YYYY-MM-DDTHH:MM:SSZ)
- arn string
The Amazon Resource Name (ARN) of the key.
- deletion
Window numberIn Days Duration in days after which the key is deleted after destruction of the resource. Must be between
7and30days. Defaults to30.- description string
Description of the key.
- enabled boolean
Specifies whether the key is enabled. Keys pending import can only be
false. Imported keys default totrueunless expired.- expiration
Model string Whether the key material expires. Empty when pending key material import, otherwise
KEY_MATERIAL_EXPIRESorKEY_MATERIAL_DOES_NOT_EXPIRE.- key
Material stringBase64 Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. The same key material can be reimported, but you cannot import different key material.
- key
State string The state of the CMK.
- key
Usage string The cryptographic operations for which you can use the CMK.
- policy string
A key policy JSON document. If you do not provide a key policy, AWS KMS attaches a default key policy to the CMK.
- {[key: string]: string}
A key-value map of tags to assign to the key.
- valid
To string Time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. If not specified, key material does not expire. Valid values: RFC3339 time string (
YYYY-MM-DDTHH:MM:SSZ)
- arn str
The Amazon Resource Name (ARN) of the key.
- deletion_
window_ floatin_ days Duration in days after which the key is deleted after destruction of the resource. Must be between
7and30days. Defaults to30.- description str
Description of the key.
- enabled bool
Specifies whether the key is enabled. Keys pending import can only be
false. Imported keys default totrueunless expired.- expiration_
model str Whether the key material expires. Empty when pending key material import, otherwise
KEY_MATERIAL_EXPIRESorKEY_MATERIAL_DOES_NOT_EXPIRE.- key_
material_ strbase64 Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. The same key material can be reimported, but you cannot import different key material.
- key_
state str The state of the CMK.
- key_
usage str The cryptographic operations for which you can use the CMK.
- policy str
A key policy JSON document. If you do not provide a key policy, AWS KMS attaches a default key policy to the CMK.
- Dict[str, str]
A key-value map of tags to assign to the key.
- valid_
to str Time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. If not specified, key material does not expire. Valid values: RFC3339 time string (
YYYY-MM-DDTHH:MM:SSZ)
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.