The code example below block device is not encrypted
resource "aws_instance" "insecure_example" {
ami = "ami-7f89a64f"
instance_type = "t1.micro"
root_block_device {
encrypted = false
}
ebs_block_device {
device_name = "/dev/sdg"
volume_size = 5
volume_type = "gp2"
delete_on_termination = false
encrypted = false
}
}
The block device could be compromised and read from
Turn on encryption for all block devices
resource "aws_instance" "secure_example" {
ami = "ami-7f89a64f"
instance_type = "t1.micro"
root_block_device {
encrypted = true
}
ebs_block_device {
device_name = "/dev/sdg"
volume_size = 5
volume_type = "gp2"
delete_on_termination = false
encrypted = true
}
}