Module library

KMS

Terraform module to create AWS KMS resources

Version

Inputs

40 / 41
aliasesoptionallist(string)

A list of aliases to create. Note - due to the use of `toset()`, values must be static strings and not computed values

Default[]
aliases_use_name_prefixoptionalbool

Determines whether the alias name is used as a prefix

Defaultfalse
bypass_policy_lockout_safety_checkoptionalbool

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

Defaultnull
computed_aliasesoptionalmap(object({ name = string }))

A map of aliases to create. Values provided via the `name` key of the map can be computed from upstream resources

Default{}
createoptionalbool

Determines whether resources will be created (affects all resources)

Defaulttrue
create_externaloptionalbool

Determines whether an external CMK (externally provided material) will be created or a standard CMK (AWS provided material)

Defaultfalse
create_replicaoptionalbool

Determines whether a replica standard CMK will be created (AWS provided material)

Defaultfalse
create_replica_externaloptionalbool

Determines whether a replica external CMK will be created (externally provided material)

Defaultfalse
custom_key_store_idoptionalstring

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

Defaultnull
customer_master_key_specoptionalstring

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_P…

Defaultnull
deletion_window_in_daysoptionalnumber

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`

Defaultnull
descriptionoptionalstring

The description of the key as viewed in AWS console

Defaultnull
enable_default_policyoptionalbool

Specifies whether to enable the default key policy. Defaults to `true`

Defaulttrue
enable_key_rotationoptionalbool

Specifies whether key rotation is enabled. Defaults to `true`

Defaulttrue
enable_route53_dnssecoptionalbool

Determines whether the KMS policy used for Route53 DNSSEC signing is enabled

Defaultfalse
grantsoptionalmap(object({ constraints = optional(list(object({ encryption_context_equals = op…

A map of grant definitions to create

Defaultnull
is_enabledoptionalbool

Specifies whether the key is enabled. Defaults to `true`

Defaultnull
key_administratorsoptionallist(string)

A list of IAM ARNs for [key administrators](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-default-allow-administrators)

Default[]
key_asymmetric_public_encryption_usersoptionallist(string)

A list of IAM ARNs for [key asymmetric public encryption users](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-users-crypto)

Default[]
key_asymmetric_sign_verify_usersoptionallist(string)

A list of IAM ARNs for [key asymmetric sign and verify users](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-users-crypto)

Default[]
key_hmac_usersoptionallist(string)

A list of IAM ARNs for [key HMAC users](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-users-crypto)

Default[]
key_material_base64optionalstring

Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. External key only

Defaultnull
key_ownersoptionallist(string)

A list of IAM ARNs for those who will have full key permissions (`kms:*`)

Default[]
key_service_roles_for_autoscalingoptionallist(string)

A list of IAM ARNs for [AWSServiceRoleForAutoScaling roles](https://docs.aws.amazon.com/autoscaling/ec2/userguide/key-policy-requirements-EBS-encryption.html#policy-example-cmk-access)

Default[]
key_service_usersoptionallist(string)

A list of IAM ARNs for [key service users](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-service-integration)

Default[]
key_specoptionalstring

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_224, HMAC_256, HMAC_384, HMAC_512, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, …

Defaultnull
key_statementsoptionallist(object({ sid = optional(string) actions = optional(list(string)) not_action…

A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage

Defaultnull
key_symmetric_encryption_usersoptionallist(string)

A list of IAM ARNs for [key symmetric encryption users](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-users-crypto)

Default[]
key_usageoptionalstring

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

Defaultnull
key_usersoptionallist(string)

A list of IAM ARNs for [key users](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-default-allow-users)

Default[]
multi_regionoptionalbool

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

Defaultfalse
override_policy_documentsoptionallist(string)

List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid`

Default[]
policyoptionalstring

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

Defaultnull
primary_external_key_arnoptionalstring

The primary external key arn of a multi-region replica external key

Defaultnull
primary_key_arnoptionalstring

The primary key arn of a multi-region replica key

Defaultnull
regionoptionalstring

Region where the resource(s) will be managed. Defaults to the Region set in the provider configuration

Defaultnull
rotation_period_in_daysoptionalnumber

Custom period of time between each rotation date. Must be a number between 90 and 2560 (inclusive)

Defaultnull
route53_dnssec_sourcesoptionallist(object({ account_ids = optional(list(string)) hosted_zone_arn = optional(st…

A list of maps containing `account_ids` and Route53 `hosted_zone_arn` that will be allowed to sign DNSSEC records

Defaultnull
source_policy_documentsoptionallist(string)

List of IAM policy documents that are merged together into the exported document. Statements must have unique `sid`s

Default[]
tagsoptionalmap(string)

A map of tags to add to all resources

Default{}

All 41 are optional — the module deploys with none of them set. Showing 40, so the site stays a static download — the remaining 1 are in the source.

Outputs

9
aliases

A map of aliases created and their attributes

external_key_expiration_model

Whether the key material expires. Empty when pending key material import, otherwise `KEY_MATERIAL_EXPIRES` or `KEY_MATERIAL_DOES_NOT_EXPIRE`

external_key_state

The state of the CMK

external_key_usage

The cryptographic operations for which you can use the CMK

grants

A map of grants created and their attributes

key_arn

The Amazon Resource Name (ARN) of the key

key_id

The globally unique identifier for the key

key_policy

The IAM resource policy set on the key

key_region

The region for the key

What the agent wires into the next module. An edge on the architecture diagram is one of these consumed by something else.