Skip to content

Instantly share code, notes, and snippets.

@munhitsu
Created August 27, 2015 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save munhitsu/16160646bb0168c0a67a to your computer and use it in GitHub Desktop.
Save munhitsu/16160646bb0168c0a67a to your computer and use it in GitHub Desktop.
aws_db_instance final_snapshot_identifier
resource "aws_db_instance" "api" {
identifier = "api-${var.stack}"
allocated_storage = 100
engine = "postgres"
engine_version = "9.3.6"
instance_class = "db.m3.medium"
storage_encrypted = true
apply_immediately = false
name = "${var.db_name}"
username = "${var.db_master_username}"
password = "${var.db_master_password}"
backup_retention_period = 14
backup_window = "00:00-00:30"
maintenance_window = "sun:01:00-sun:01:30"
publicly_accessible = false
multi_az = true
vpc_security_group_ids = [
"${aws_security_group.default.id}",
"${aws_security_group.rds_api.id}"
]
db_subnet_group_name = "private-${var.stack}"
storage_type = "io1"
iops = 1000
final_snapshot_identifier = "final-api-${var.stack}-${aws_security_group.rds_api.id}"
tags {
Name = "api.${var.stack}.${var.domain}"
Stack = "${var.stack}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment