Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable DB deletion protection across all GCP API surfaces #1150

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion terraform/gcp/modules/mysql-shard/mysql.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ resource "google_sql_database_instance" "trillian" {
database_version = var.database_version
region = var.region

# Set to false to delete this database
# Set to false to delete this database using terraform
deletion_protection = var.deletion_protection

settings {
tier = var.tier
activation_policy = "ALWAYS"
availability_type = var.availability_type

# this sets the flag on the GCP platform to prevent deletion across all API surfaces
deletion_protection_enabled = var.deletion_protection

ip_configuration {
ipv4_enabled = var.ipv4_enabled
private_network = var.network
Expand Down
5 changes: 4 additions & 1 deletion terraform/gcp/modules/mysql/mysql.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ resource "google_sql_database_instance" "sigstore" {
database_version = var.database_version
region = var.region

# Set to false to delete this database
# Set to false to delete this database using terraform
deletion_protection = var.deletion_protection

depends_on = [google_service_networking_connection.private_vpc_connection]
Expand All @@ -119,6 +119,9 @@ resource "google_sql_database_instance" "sigstore" {
activation_policy = "ALWAYS"
availability_type = var.availability_type

# this sets the flag on the GCP platform to prevent deletion across all API surfaces
deletion_protection_enabled = var.deletion_protection

ip_configuration {
ipv4_enabled = var.ipv4_enabled
private_network = var.network
Expand Down