Description
With encrypted = true, omitting kms_key_id encrypts files with the AWS managed EFS key. Choose a customer managed key when you need control of its policy and lifecycle.
Potential impact
Disabling or deleting a customer managed key that EFS still uses can interrupt file access.
Remediation
Set kms_key_id to a customer managed key ARN in the same Region and check permission to use it. To change keys, review the Terraform replacement plan. Keep the source and copy the data to a separate file system with a different creation token. If applications are still writing, pause source writes and run a final sync. Verify file permissions, network access and reads and writes before switching mounts.
Examples
Before
resource "aws_efs_file_system" "example" {
creation_token = "my-product"
encrypted = true
}
After
resource "aws_efs_file_system" "example" {
creation_token = "my-product"
encrypted = true
kms_key_id = "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab"
}
Both excerpts enable encryption at rest. Supply the ARN of your actual key in the second.