Complete AWS KMS Example

Terraform scripts to create a complete AWS KMS using the module kms.

To create a complete AWS KMS:

terraform init
terraform plan
terraform apply

To delete all resource:

terraform destroy

Note that this example may create resources which will incur monetary charges on your AWS bill. Run terraform destroy when you no longer need these resources.

Requirements

Name

Version

terraform

>= 1.0

aws

>= 5.61

external

~> 2.3.1

null

>= 3.2.1

Providers

Name

Version

aws

>= 5.61

external

~> 2.3.1

null

>= 3.2.1

Modules

Name

Source

Version

kms_complete

../../../kms

n/a

Resources

Name

Type

aws_iam_role.lambda

resource

null_resource.timestamp

resource

aws_caller_identity.current

data source

aws_region.current

data source

external_external.static_timestamp

data source

Inputs

Name

Description

Type

Default

Required

aws_profile

Profile of AWS credentials to deploy Terraform sources

string

"default"

no

aws_region

AWS region where the infrastructure will be deployed

string

"eu-west-3"

no

Outputs

Name

Description

alias

KMS alias

complete_key_arn

The Amazon Resource Name (ARN) of the key

complete_key_id

The globally unique identifier for the key