Closed dgillman closed 2 months ago
Hi @dgillman!
I tried to replicate this issue, but everything was successful without errors. So I suggest you modify your code just for test purposes without using locals, variables and for each block and check each one of these components to confirm their values are correct.
It is important to say that this is a good practice but it is just for test purposes since we don't have access to that information, or if you don't have any sensitive data you could share the full code to make other try.
Thanks, @ggtisc. I got to the bottom of this through a bunch of trial and error. The issue was the google_compute_global_forwarding_rule
which ultimately orchestrated the front end load balancer. It was declared with load_balancing_scheme = "EXTERNAL"
(ie. classic load balancer). Custom error polices are not supported in this configuration. The error is probably complicated by the URL Map and Forwarding Rule having already existed, as the API calls would have been incompatible updates on existing resources instead of a new configuration.
I guess root causing this, it was a lack of clarity on the constraints around the underlying resources that the underlying load balancing resources. But it took a lot of digging to get there. If there is any validation phase which might have caught this, I'd happily take a crack at a PR to pre-empt errors like this with a sanity check. But this is definitely edge case-y.
Anyway, thanks for giving this your time. Closing the issue
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform Version & Provider Version(s)
Terraform v1.5.6 on darwin_amd64
Affected Resource(s)
google_compute_url_map
Terraform Configuration
Before
After
Debug Output
https://gist.github.com/dgillman/cc57044a2104fa18e10a6c4a3397c73d
Expected Behavior
Error response policies should be created on the existing URL map.
Actual Behavior
The provider reports a 400 response from the Google compute API with an uninterpretable error message:
Error waiting for Updating UrlMap: generic::invalid_argument: Message does not pass whitelist validation. The offending field is a submessage of UrlMap (UrlMap) at field number 10 (UnknownField::Type 3).
Steps to reproduce
terraform apply
Important Factoids
I have attempted to directly configure these same resources using the
gcloud
command line tool based on instructions from Google documentation. That attempt fails with a different error message. Details of that issue are contained in a ticket lodged with the Google API team: https://issuetracker.google.com/issues/356907809References
No response