aws_lb: Handle case where no updated attributes are supported #35228
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When an update to an LB is desired the provider repeatedly calls
ModifyLoadBalancerAttributesWithContext()
, removing attributes-to-update as needed when the appropriate error is returned, e.g.InvalidConfigurationRequest: Load balancer attribute key 'dns_record.client_routing_policy' is not supported on load balancers with type 'network'
will cause a retry without thedns_record.client_routing_policy
attribute.When there is only one attribute to update and it is not supported in this partition, we hit a case where we'll retry the
Modify...
call with an empty attribute list. This is the case in the related issue.The fix is to no-op if the attributes list is pruned to the empty slice.
ℹ️ I'm not sure how to write a new acceptance test for this one because the only way to hit this edge case that I know of (I know very little about the AWS provider to be fair) is to upgrade the provider from version
5.22
to5.31
, which isn't that easy to test.Relations
Closes #35014
References
Output from Acceptance Testing
Manual testing
Before the fix, I was able to reproduce the error using a local
make build
of the provider and the minimal reproducing TF configuration from #35014.After the fix, I am able to upgrade from provider version
5.22
to my build frommain
branch and do the following: