Pattern: Disabled automated backups for Google SQL
Issue: -
Automated backups are not enabled by default. Backups are an easy way to restore data in a corruption or data-loss scenario.
Resolution: Enable automated backups.
Example of incorrect code:
resource "google_sql_database_instance" "db" {
name = "db"
database_version = "POSTGRES_12"
region = "us-central1"
settings {
backup_configuration {
enabled = false
}
}
}
Example of correct code:
resource "google_sql_database_instance" "db" {
name = "db"
database_version = "POSTGRES_12"
region = "us-central1"
settings {
backup_configuration {
enabled = true
}
}
}