Default database KMS key usage

Check whether an encrypted database’s default KMS key meets your key-management requirements.

Description

Both Aurora MySQL examples encrypt storage with StorageEncrypted: true. Omitting KmsKeyId in this configuration selects the default AWS managed KMS key for the account and Region.

Potential impact

Choose a customer managed key if you need to control its policy or lifecycle, or use separate keys for different services. Existing backups still need access to the key that encrypted them.

Remediation

For a new cluster, set KmsKeyId to the approved key ARN. Grant the deployment identity and Aurora the necessary key permissions and limit who can disable or delete the key. Changing KmsKeyId on an existing cluster requires replacement. Pause writes on the original cluster, take a manual snapshot and restore it to a separate cluster under the new key. Keep writes paused until you verify the writer and data and switch the application.

Examples

Supply DatabaseKeyArn as the ARN of a customer managed key in the cluster’s Region. Configure credentials, networking and the writer instance separately.

Before

yaml
Resources:
  AppDbCluster:
    Type: AWS::RDS::DBCluster
    Properties:
      Engine: aurora-mysql
      StorageEncrypted: true

After

yaml
Resources:
  AppDbCluster:
    Type: AWS::RDS::DBCluster
    Properties:
      Engine: aurora-mysql
      StorageEncrypted: true
      KmsKeyId: !Ref DatabaseKeyArn

References