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.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/terraform-aws-modules/terraform-aws-eks/llms.txt
Use this file to discover all available pages before exploring further.
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.
| Variable | Type | Default | Constraints |
|---|---|---|---|
enable_kms_key_rotation | bool | true | — |
kms_key_rotation_period_in_days | number | 365 | 90–2560 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:
| Variable | Permission Level | Default Behavior |
|---|---|---|
kms_key_owners | kms:* (full access) | [] — no additional owners |
kms_key_administrators | Administer the key (rotate, schedule deletion, etc.) | [] — falls back to current caller identity |
kms_key_users | Encrypt and decrypt operations | [] |
kms_key_service_users | Service integration (grants, etc.) | [] |
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.
Full Variable Reference
| Variable | Type | Default | Description |
|---|---|---|---|
create_kms_key | bool | true | Create a KMS key for cluster encryption |
encryption_config | object | {} | Encryption config; set provider_key_arn to BYO key |
attach_encryption_policy | bool | true | Attach IAM policy to cluster role to use the KMS key |
enable_kms_key_rotation | bool | true | Enable automatic KMS key rotation |
kms_key_rotation_period_in_days | number | 365 | Rotation period in days (90–2560) |
kms_key_deletion_window_in_days | number | 30 | Deletion window in days (7–30) |
kms_key_administrators | list(string) | [] | IAM ARNs for key administrators |
kms_key_users | list(string) | [] | IAM ARNs for key users |
kms_key_service_users | list(string) | [] | IAM ARNs for key service users |
kms_key_owners | list(string) | [] | IAM ARNs for full key permissions (kms:*) |
kms_key_aliases | list(string) | [] | Aliases to create for the key |
kms_key_description | string | null | Description of the key |
kms_key_enable_default_policy | bool | true | Enable the default KMS key policy |
cloudwatch_log_group_kms_key_id | string | null | KMS key ARN for encrypting the CloudWatch log group |
