File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,20 @@ module "postgresql_db" {
2424 access_tags = var. access_tags
2525}
2626
27+ # On destroy, we are seeing that even though the replica has been returned as
28+ # destroyed by terraform, the leader instance destroy can fail with: "You
29+ # must delete all replicas before disabling the leader. Try again with valid
30+ # values or contact support if the issue persists."
31+ # The ICD team have recommended to wait for a period of time after the replica
32+ # destroy completes before attempting to destroy the leader instance, so hence
33+ # adding a time sleep here.
34+
35+ resource "time_sleep" "wait_time" {
36+ depends_on = [module . postgresql_db ]
37+
38+ destroy_duration = " 5m"
39+ }
40+
2741# #############################################################################
2842# ICD postgresql read-only-replica
2943# #############################################################################
@@ -40,4 +54,5 @@ module "read_only_replica_postgresql_db" {
4054 remote_leader_crn = module. postgresql_db . crn
4155 member_memory_mb = 2304 # Must be an increment of 384 megabytes. The minimum size of a read-only replica is 2 GB RAM
4256 member_disk_mb = 15360 # Must be an increment of 512 megabytes. The minimum size of a read-only replica is 15.36 GB of disk
57+ depends_on = [time_sleep . wait_time ]
4358}
Original file line number Diff line number Diff line change @@ -6,5 +6,10 @@ terraform {
66 source = " IBM-Cloud/ibm"
77 version = " 1.54.0"
88 }
9+
10+ time = {
11+ source = " hashicorp/time"
12+ version = " 0.9.1"
13+ }
914 }
1015}
You can’t perform that action at this time.
0 commit comments