Infra & Cloud terraform Intermediate

AWS RDS Postgres Terraform

Terraform resource for an RDS PostgreSQL instance with encryption and backup.

terraform
resource "aws_db_instance" "postgres" {
  identifier              = var.name
  engine                  = "postgres"
  engine_version          = "16"
  instance_class          = "db.t3.micro"
  allocated_storage       = 20
  username                = var.db_user
  password                = var.db_pass
  storage_encrypted       = true
  backup_retention_period = 7
  skip_final_snapshot     = false
}

Prerequisites

  • terraform >= 1.0
  • AWS provider

Pro Tips

  • → Enable Multi-AZ for production.

Was this module useful?

Share your experience — it helps the team improve.

Leave Feedback

Commercial Licensing

Acquire a production access token or template license for enterprise deployment.

Module Info

Language
terraform
Level
Intermediate
Read time
4 min
Published
Sep 2026
License
Commercial License

Newsletter

New modules every week, directly to your inbox.