Skip to content

Commit

Permalink
Update postgresql_flexible_server.html.markdown (#24593)
Browse files Browse the repository at this point in the history
* Update postgresql_flexible_server.html.markdown

Using the example code from this document on terraform destroy operations the azurerm_subnet will have its DELETE request sent before the azurerm_private_dns_zone_virtual_network_link resource has completed its deletion. 

This results in the error "InUseSubnetCannotBeDeleted" and the azurerm_virtual_network with the azurerm_subnet not being deleted by the terraform destroy command. 

Adding the depends_on forces Terraform to wait until the azurerm_private_dns_zone_virtual_network_link is fully deleted before attempting to delete the azurerm_subnet resource allowing the destroy to complete without error.

* Updated format for change using terraform fmt command

---------

Co-authored-by: Joshua Donovan <Josh@alcanweb.com>
  • Loading branch information
Joshua-Donovan and Joshua Donovan authored Jan 23, 2024
1 parent b193c12 commit 20707b4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions website/docs/r/postgresql_flexible_server.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ resource "azurerm_private_dns_zone_virtual_network_link" "example" {
private_dns_zone_name = azurerm_private_dns_zone.example.name
virtual_network_id = azurerm_virtual_network.example.id
resource_group_name = azurerm_resource_group.example.name
depends_on = [azurerm_subnet.example]
}
resource "azurerm_postgresql_flexible_server" "example" {
Expand Down

0 comments on commit 20707b4

Please sign in to comment.