Description
For a new EBS volume, set Encrypted: true to protect its data and snapshots at rest. Regional encryption defaults and the source snapshot also affect the result. Check deployed volumes and snapshots even when this property is false or omitted.
Potential impact
An unencrypted volume can fall outside your data-protection requirements. Losing KMS access to an encrypted volume or switching volumes before migrating their data can disrupt a workload or prevent recovery.
Remediation
CloudFormation cannot update Encrypted on an existing volume, and turning on regional defaults does not encrypt existing volumes or snapshots. Take a consistent snapshot, make an encrypted copy, and create the replacement volume from it. Plan the attachment change and any interruption. Check key permissions, the restored data and workload access before retiring the source.
Examples
Both templates create an empty volume. Choose the same Availability Zone as the instance that will attach it. DeletionPolicy: Snapshot preserves a snapshot on stack deletion. Data migration and attachment are separate steps.
Encryption not requested
AWSTemplateFormatVersion: "2010-09-09"
Description: Volume
Parameters:
VolumeAvailabilityZone:
Type: AWS::EC2::AvailabilityZone::Name
Resources:
NewVolume:
Type: AWS::EC2::Volume
Properties:
Size: 100
Encrypted: false
AvailabilityZone: !Ref VolumeAvailabilityZone
Tags:
- Key: MyTag
Value: TagValue
DeletionPolicy: Snapshot
With regional encryption by default turned off, the first template can create an unencrypted volume.
Encryption requested
AWSTemplateFormatVersion: "2010-09-09"
Description: Volume
Parameters:
VolumeAvailabilityZone:
Type: AWS::EC2::AvailabilityZone::Name
Resources:
NewVolume:
Type: AWS::EC2::Volume
Properties:
Size: 100
Encrypted: true
AvailabilityZone: !Ref VolumeAvailabilityZone
Tags:
- Key: MyTag
Value: TagValue
DeletionPolicy: Snapshot
The second uses the default KMS key for the new volume. Set KmsKeyId if a specific approved key is required.