Default Behavior
By default, the module:- Creates a new KMS key (
create_kms_key = true) - Enables automatic key rotation (
enable_kms_key_rotation = true) - Encrypts Kubernetes
secretswith that key - Attaches an IAM policy to the cluster role allowing it to use the key
KMS Key Creation
Module-Created Key (Default)
Bringing Your Own KMS Key
Disable key creation and provide your own key ARN viaencryption_config:
When
create_kms_key = false and encryption_config.provider_key_arn is set, the module still attaches an IAM policy to the cluster role to use the provided key (controlled by attach_encryption_policy = true).Disabling Encryption
To create a cluster without secrets encryption, set bothcreate_kms_key = false and leave encryption_config empty:
Encrypted Resources
Theencryption_config.resources list controls which Kubernetes resources are encrypted. The only currently supported value is secrets.
Key Rotation
Key rotation is enabled by default. Customize the rotation schedule withkms_key_rotation_period_in_days.
Key Administrators, Users, and Owners
The module uses theterraform-aws-modules/kms/aws submodule internally. You control who has access to the key through three variables:
If
kms_key_administrators is empty, the module uses the current caller identity as the key administrator to ensure at least one administrator always has access.Key Deletion Window and Aliases
CloudWatch Log Group Encryption
EKS control plane logs are written to a CloudWatch Log Group. Encrypt that log group with a separate KMS key usingcloudwatch_log_group_kms_key_id.
