Open wjf3121 opened 10 months ago
I think that PSC forwarding rules can't have labels set, based on https://github.com/hashicorp/terraform-provider-google/issues/16255#issue-1945151168 - we'll need to not apply default labels for forwarding rules of that type.
Does a workaround exist?
If you create the resource without labels initially, and then update it to include labels, it works correctly (as a workarround). What I did was
default_labels
google_compute_forwarding_rule
default_labels
google_compute_forwarding_rule
to add labelsThat's what I've been doing until I got tired of it and just stopped using provider-defined labels.
Now I declare/compute a standard set of labels and just apply them to each resource that can take labels. google_compute_forwarding_rule
is not one.
I think that PSC forwarding rules can't have labels set, based on #16255 (comment) - we'll need to not apply default labels for forwarding rules of that type.
They can. What is stupid is that the labels can't be set at creation time (GCP API limitation) but only added after the resource already exists.
Is there a way to ignore provider-level labels for a particular resource by some statement?
This happens with provider 5.2.0 and when the default labels are defined at provider level and there is no label block in google_compute_forwarding_rule itself:
Affected Resource(s)
google_compute_forwarding_rule
Originally posted by @Ziemowit-LH in https://github.com/hashicorp/terraform-provider-google/issues/16255#issuecomment-1773031396
b/327610708