Skip to content

Commit fd0908f

Browse files
Fix: GCS bucket release failing if custom_labels not present (#473)
* Fix: GCS bucket release failing if custom_labels not present * change in bucket.tf too
1 parent f685d33 commit fd0908f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

modules/google_cloud_storage/default/0.2/bucket.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ resource "google_storage_bucket" "bucket" {
5555
# Labels
5656
labels = merge(
5757
var.environment.cloud_tags,
58-
var.instance.spec.custom_labels
58+
lookup(var.instance.spec, "custom_labels", {})
5959
)
6060

6161
# Force destroy for easier cleanup in testing

modules/google_cloud_storage/default/0.2/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ variable "instance" {
1616
action = string
1717
storage_class = string
1818
})
19-
custom_labels = map(string)
19+
custom_labels = optional(map(string), {})
2020
# location is now fully optional and not required in the type definition
2121
})
2222
})

0 commit comments

Comments
 (0)