Skip to main content
The module encrypts EKS cluster secrets using a KMS Customer Managed Key (CMK) by default. You can control every aspect of the key: creation, rotation, access policies, and deletion behavior. CloudWatch log group encryption is configured separately.

Default Behavior

By default, the module:
  1. Creates a new KMS key (create_kms_key = true)
  2. Enables automatic key rotation (enable_kms_key_rotation = true)
  3. Encrypts Kubernetes secrets with that key
  4. 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 via encryption_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 both create_kms_key = false and leave encryption_config empty:

Encrypted Resources

The encryption_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 with kms_key_rotation_period_in_days.

Key Administrators, Users, and Owners

The module uses the terraform-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 using cloudwatch_log_group_kms_key_id.
The KMS key used for CloudWatch Logs must have an appropriate key policy granting the CloudWatch Logs service (logs.<region>.amazonaws.com) the kms:Encrypt*, kms:Decrypt*, kms:ReEncrypt*, kms:GenerateDataKey*, and kms:Describe* permissions. Without this, log delivery will fail.

Full Variable Reference