File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -264,7 +264,9 @@ locals {
264264 has_certificates = var. ca_certificate != null || (var. certificate_secret_id != " " && var. certificate_secret_read )
265265}
266266
267- # Upload combined trust bundle certificate to GCS bucket
267+ # Upload combined trust bundle certificate to GCS bucket.
268+ # create_before_destroy ensures the new object is written before the old
269+ # one is removed, preventing a gap if terraform apply is interrupted.
268270resource "google_storage_bucket_object" "trust_bundle" {
269271 count = local. has_certificates ? 1 : 0
270272
@@ -284,6 +286,10 @@ resource "google_storage_bucket_object" "trust_bundle" {
284286 has_ca_cert = var.ca_certificate != null ? " true" : " false"
285287 has_secret_cert = var.certificate_secret_id != " " && var.certificate_secret_read ? " true" : " false"
286288 }
289+
290+ lifecycle {
291+ create_before_destroy = true
292+ }
287293}
288294
289295# Upload Docker config.json to GCS bucket if provided
You can’t perform that action at this time.
0 commit comments