Skip to content

Files

Latest commit

 

History

History
41 lines (32 loc) · 765 Bytes

google-sql-enable-backup.md

File metadata and controls

41 lines (32 loc) · 765 Bytes

Pattern: Disabled automated backups for Google SQL

Issue: -

Description

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.

Examples

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
		}
	}
}