Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_subnet_resource - Lock virtual network and subnet on update #13726

Merged
merged 1 commit into from
Oct 13, 2021

Conversation

owenfarrell
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Summary

This pull request locks the subnet resource and associated virtual network when updating subnets to prevent conflicting, concurrent operations.

Fixes: #13564

Output from acceptance testing:

$ make acctests SERVICE='network' TESTARGS='-run="^TestAccSubnet_"'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/network -run="^TestAccSubnet_" -timeout 180m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccSubnet_basic
=== PAUSE TestAccSubnet_basic
=== RUN   TestAccSubnet_basic_addressPrefixes
=== PAUSE TestAccSubnet_basic_addressPrefixes
=== RUN   TestAccSubnet_complete_addressPrefixes
=== PAUSE TestAccSubnet_complete_addressPrefixes
=== RUN   TestAccSubnet_update_addressPrefixes
=== PAUSE TestAccSubnet_update_addressPrefixes
=== RUN   TestAccSubnet_requiresImport
=== PAUSE TestAccSubnet_requiresImport
=== RUN   TestAccSubnet_disappears
=== PAUSE TestAccSubnet_disappears
=== RUN   TestAccSubnet_delegation
=== PAUSE TestAccSubnet_delegation
=== RUN   TestAccSubnet_enforcePrivateLinkEndpointNetworkPolicies
=== PAUSE TestAccSubnet_enforcePrivateLinkEndpointNetworkPolicies
=== RUN   TestAccSubnet_enforcePrivateLinkServiceNetworkPolicies
=== PAUSE TestAccSubnet_enforcePrivateLinkServiceNetworkPolicies
=== RUN   TestAccSubnet_serviceEndpoints
=== PAUSE TestAccSubnet_serviceEndpoints
=== RUN   TestAccSubnet_serviceEndpointPolicy
=== PAUSE TestAccSubnet_serviceEndpointPolicy
=== RUN   TestAccSubnet_updateAddressPrefix
=== PAUSE TestAccSubnet_updateAddressPrefix
=== CONT  TestAccSubnet_basic
=== CONT  TestAccSubnet_delegation
=== CONT  TestAccSubnet_update_addressPrefixes
=== CONT  TestAccSubnet_serviceEndpoints
=== CONT  TestAccSubnet_enforcePrivateLinkEndpointNetworkPolicies
=== CONT  TestAccSubnet_enforcePrivateLinkServiceNetworkPolicies
=== CONT  TestAccSubnet_serviceEndpointPolicy
=== CONT  TestAccSubnet_complete_addressPrefixes
=== CONT  TestAccSubnet_updateAddressPrefix
--- PASS: TestAccSubnet_basic (202.03s)
--- PASS: TestAccSubnet_complete_addressPrefixes (374.71s)
=== CONT  TestAccSubnet_basic_addressPrefixes
--- PASS: TestAccSubnet_serviceEndpointPolicy (415.83s)
=== CONT  TestAccSubnet_disappears
--- PASS: TestAccSubnet_enforcePrivateLinkEndpointNetworkPolicies (473.57s)
=== CONT  TestAccSubnet_requiresImport
--- PASS: TestAccSubnet_update_addressPrefixes (475.50s)
--- PASS: TestAccSubnet_enforcePrivateLinkServiceNetworkPolicies (488.09s)
--- PASS: TestAccSubnet_serviceEndpoints (522.45s)
--- PASS: TestAccSubnet_updateAddressPrefix (368.98s)
--- PASS: TestAccSubnet_disappears (157.32s)
--- PASS: TestAccSubnet_basic_addressPrefixes (222.55s)
--- PASS: TestAccSubnet_delegation (615.58s)
--- PASS: TestAccSubnet_requiresImport (172.97s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/network       649.314s

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing another one of these @owenfarrell! LGTM 🏗️

@katbyte katbyte merged commit ad1ad08 into hashicorp:main Oct 13, 2021
katbyte added a commit that referenced this pull request Oct 13, 2021
@owenfarrell owenfarrell deleted the subnet-update branch October 14, 2021 00:12
@github-actions
Copy link

This functionality has been released in v2.81.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition when updating multiple subnet service endpoints
2 participants