Skip to content

RDS DB instance encryption at rest should be enabled

To help protect data at rest, ensure that encryption is enabled for your AWS Relational Database Service (AWS RDS) instances.

How to fix

Attribute storage_encrypted of aws_db_instance must be true.

Implementation options

Choose the option that matches how you manage Terraform. All options satisfy this control.

Use the compliance.tf registry module to get this control enforced by default. This control is mapped to the frameworks shown in the tabs above. To begin, see get started with compliance.tf.

module "rds" {
  source  = "awscontroltower.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "cfrpart11.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "cisv500.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "cisv600.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "cisv80ig1.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "cisacyberessentials.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "eugmpannex11.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "fedrampmoderate.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "ffiec.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "gdpr.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "hipaa.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "hipaasecurity2003.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "nist800171.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "nist80053rev4.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "nist80053.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "nistcsfv11.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "nistcsf.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "nydfs23.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "pcidssv321.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "pcidss.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "rbicybersecurity.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}
module "rds" {
  source  = "soc2.compliance.tf/terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]
}

Option 2: Open source module (terraform-aws-modules)

If you use terraform-aws-modules/rds/aws, configure the required module inputs to satisfy this control. You can later migrate to the compliance.tf module with minimal changes because it is compatible by design.

module "rds" {
  source  = "terraform-aws-modules/rds/aws"
  version = ">=7.0.0"

  allocated_storage      = 20
  db_name                = "myapp"
  db_subnet_group_name   = "example-db-subnet-group"
  engine                 = "postgres"
  engine_version         = "16.1"
  identifier             = "abc123"
  instance_class         = "db.t3.micro"
  password               = "change-me-in-production"
  username               = "dbadmin"
  vpc_security_group_ids = ["sg-12345678"]

  storage_encrypted = true
}

Option 3: Terraform AWS provider resources

If you manage resources directly, configure the relevant Terraform AWS provider resources to meet this control. See docs for the resources involved: aws_db_instance.

resource "aws_db_instance" "this" {
  allocated_storage               = 20
  enabled_cloudwatch_logs_exports = ["general", "slowquery"]
  engine                          = "mysql"
  identifier                      = "pofix-example-db"
  instance_class                  = "db.t3.micro"
  monitoring_interval             = 60
  monitoring_role_arn             = "arn:aws:iam::123456789012:role/example-role"
  password                        = "ChangeMe123!"
  skip_final_snapshot             = true
  username                        = "dbadmin"

  storage_encrypted = true
}
Which option should I choose?
  • Compliance.tf module (recommended): controls enforced by default and mapped to frameworks.
  • Open source module (terraform-aws-modules): compatible by design with compliance.tf. Same variable names for an easy, low-change migration path when you are ready.
  • Terraform AWS provider resources: manage Terraform resources directly.

Tool mappings

Use these identifiers to cross-reference this control across tools, reports, and evidence.

  • Compliance.tf (CTF) Control: rds_db_instance_encryption_at_rest_enabled

  • Checkov Check: CKV_AWS_16

  • Powerpipe Controls: aws_compliance.control.cis_v500_2_2_1, aws_compliance.control.cis_v600_3_2_1, aws_compliance.control.rds_db_instance_encryption_at_rest_enabled