resource "aws_db_instance" "rds_db_instance_name" {
identifier = "${var.env_prefix}-rds"
# name = "${var.env_prefix}"
# final_snapshot_identifier = "${var.env_prefix}-rds-backup"
skip_final_snapshot = true
apply_immediately = true
allow_major_version_upgrade = false
backup_retention_period = 0
allocated_storage = 20
storage_type = "gp2"
engine = "postgres"
engine_version = "11.8"
instance_class = "db.t2.micro"
# username = local.rds-creds.username
# password = local.rds-creds.password
db_subnet_group_name = aws_db_subnet_group.rds_db_subnet_group.id
vpc_security_group_ids = [var.rds_sg_id]
parameter_group_name = "default.postgres11"
snapshot_identifier = data.aws_db_snapshot.latest_prod_snapshot.id
lifecycle {
ignore_changes = [snapshot_identifier]
}
}
Собстевенно он убивает базу и создает ее по новой из снапшота... Вот и вся история