azurerm_virtual_network_gateway: restore ExpressRoute legacy public_ip_address_id behavior#31771
Open
alkarp wants to merge 8 commits intohashicorp:mainfrom
Conversation
Collaborator
|
Hi @alkarp, thanks for the PR. For the testing part, please add stuiable acctest and provide the test result, instead of the |
ziyeqf
reviewed
Mar 5, 2026
Author
|
Hi @ziyeqf, thanks for the review. I’ve addressed your comments:
local targeted test compile/harness check passed: For the full acceptance test result: I don’t currently have an environment available to run it. |
7dfa3dd to
6609350
Compare
6609350 to
1e69507
Compare
Author
|
apologies for the conflict resolution via web UI fiasco. branch has been cleared, conflicts resolved. |
ziyeqf
reviewed
Mar 6, 2026
Collaborator
|
Hi @alkarp, thanks for the update. I left one comment in line and triggered a testing for |
ziyeqf
reviewed
Mar 6, 2026
Collaborator
Author
|
@ziyeqf please, give it another review, comments resolved. |
ziyeqf
reviewed
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Community Note
Description
This PR restores legacy
azurerm_virtual_network_gatewaybehavior for ExpressRoute gateways by preservingip_configuration.public_ip_address_idin state when Azure returns it for existing brownfield resources.What changed
ip_configuration.public_ip_address_idfromVirtualNetworkGatewayIPConfiguration.Properties.PublicIPAddress.Id.flattenVirtualNetworkGatewayIPConfigurationswith table-driven tests for:public_ip_address_idazurerm_virtual_network_gatewayto reflect behavior.PR Checklist
Changes to existing Resource / Data Source
Testing
Command:
go test ./internal/services/network -run '^(TestVirtualNetworkGatewayResource_NoCustomizeDiff|TestFlattenVirtualNetworkGatewayIPConfigurations)$'Output:
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/network 1.937sCommand:
go test ./internal/services/networkOutput:
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/network 1.755sCommand:
go test ./internal/services/network -run '^(TestVirtualNetworkGatewayResource_NoCustomizeDiff|TestFlattenVirtualNetworkGatewayIPConfigurations)$'Output:
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/network (cached)Command:
go test ./internal/services/networkOutput:
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/network (cached)Change Log
N/A - maintainers manage changelog entries during merge.
This is a (please select all that apply):
Related Issue(s)
Fixes #31730
AI Assistance Disclosure
Extent: AI assistance was used for unit test additions and PR drafting.
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the provider.
Changes to Security Controls
No changes to security controls (access controls, encryption, logging).