Allow in place Subnet Secondary IP ranges updates#16858
Allow in place Subnet Secondary IP ranges updates#16858slevenick merged 2 commits intoGoogleCloudPlatform:mainfrom
Conversation
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 1398 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
LGTM. @slevenick, would you like to give it a secondary round of review (this issue is really old)? Thanks. |
39b6152
The Problem
The Google Cloud Compute API for Subnetworks imposes a restriction: secondary IP ranges cannot be added and deleted within the same
patchorupdaterequest. Currently, this limitation prevents Terraform from performing:terraform apply.The Solution
This PR introduces logic to the
google_compute_subnetworkresource to sequence the API operations. It ensures that any pending deletions of secondary IP ranges are processed and committed before the API call for additions is initiated.By decoupling these operations into a sequential workflow, we bypass the API's "single-call" constraint and allow for more complex subnet modifications without manual intervention or multi-stage applies.
Fixes hashicorp/terraform-provider-google#2570