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

New Private Link race condition fix #82

Merged
merged 2 commits into from
Aug 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,15 @@ resource azurerm_private_endpoint vault_endpoint {
subresource_names = ["vault"]
}

provisioner local-exec {
command = "az resource wait --updated --ids ${self.subnet_id}"
}

tags = local.tags

depends_on = [
module.network
]
count = var.deploy_firewall ? 1 : 0
}
resource azurerm_private_dns_a_record vault_dns_record {
Expand Down
4 changes: 4 additions & 0 deletions terraform/modules/network/private-link.tf
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ resource azurerm_private_endpoint diag_blob_storage_endpoint {
subresource_names = ["azuremonitor"]
}

provisioner local-exec {
command = "az resource wait --updated --ids ${self.subnet_id}"
}

tags = var.tags
count = var.deploy_firewall ? 1 : 0
depends_on = [
Expand Down
6 changes: 5 additions & 1 deletion terraform/modules/packer/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ resource azurerm_private_endpoint images_blob_storage_endpoint {
subresource_names = ["blob"]
}

provisioner local-exec {
command = "az resource wait --updated --ids ${self.subnet_id}"
}

tags = var.tags

depends_on = [
depends_on = [
null_resource.private_endpoint_nsg_association,
time_sleep.private_endpoint_subnet
]
Expand Down
20 changes: 20 additions & 0 deletions terraform/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,15 @@ resource azurerm_private_endpoint diag_blob_storage_endpoint {
subresource_names = ["blob"]
}

provisioner local-exec {
command = "az resource wait --updated --ids ${self.subnet_id}"
}

tags = local.tags

depends_on = [
azurerm_private_endpoint.vault_endpoint,
module.network
]
count = var.deploy_firewall ? 1 : 0
}
Expand Down Expand Up @@ -108,10 +113,15 @@ resource azurerm_private_endpoint aut_blob_storage_endpoint {
subresource_names = ["blob"]
}

provisioner local-exec {
command = "az resource wait --updated --ids ${self.subnet_id}"
}

tags = local.tags

depends_on = [
azurerm_private_endpoint.diag_blob_storage_endpoint,
module.network
]
count = var.deploy_firewall ? 1 : 0
}
Expand Down Expand Up @@ -143,10 +153,15 @@ resource azurerm_private_endpoint disk_access_endpoint {
subresource_names = ["disks"]
}

provisioner local-exec {
command = "az resource wait --updated --ids ${self.subnet_id}"
}

tags = local.tags

depends_on = [
azurerm_private_endpoint.aut_blob_storage_endpoint,
module.network
]
count = var.deploy_firewall ? 1 : 0
}
Expand Down Expand Up @@ -192,10 +207,15 @@ resource azurerm_private_endpoint diagnostics_share {
subresource_names = ["file"]
}

provisioner local-exec {
command = "az resource wait --updated --ids ${self.subnet_id}"
}

tags = local.tags

depends_on = [
azurerm_private_endpoint.disk_access_endpoint,
module.network
]

count = var.deploy_files_share ? 1 : 0
Expand Down