Skip to content

Commit e6efb9b

Browse files
committed
More details on database disk sizing and deletion protection
1 parent eb4b45b commit e6efb9b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/concourse/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ resource "google_sql_database_instance" "concourse" {
118118
# This option prevents Terraform from deleting an instance
119119
deletion_protection = true
120120
```
121+
Note that if you really want to delete the database, Terraform will not allow this because `deletion_protection = true` is stored in the state. You first have to disable this flag, then run `apply` and then you can run a deletion operation.
121122

122123
In addition, we are setting a flag that enables the "Prevent instance deletion" option from the GCP console:
123124
```

docs/concourse/concourse_minor_version_upgrade.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ Please note the process should be also useful for upgrading major versions.
2020
```
2121
terragrunt run-all plan --terragrunt-source-update
2222
```
23+
Note: The Cloud SQL database has "automatic storage increases" enabled. So the disk could have grown larger than the initial value from the `config.yaml` file. In that case, Terraform would have to shrink the disk which is not possible. Instead, it tries to destroy the database and recreate it, losing all data including backups:
24+
```
25+
STDOUT [infra] tofu: -/+ resource "google_sql_database_instance" "concourse" {
26+
STDOUT [infra] tofu: ~ settings {
27+
STDOUT [infra] tofu: ~ disk_size = 44 -> 38 # forces replacement
28+
(...)
29+
STDOUT [infra] tofu: Plan: 1 to add, 1 to change, 1 to destroy.
30+
```
31+
Deletion protection is enabled on Terraform level, so this change could not be applied. To proceed, configure a bigger `sql_instance_disk_size` in the `config.yaml`.
2332

2433
4. Switch to `renovate's` pull request having bumped Concourse helm chart version
2534
```

0 commit comments

Comments
 (0)