Closed esdccs1 closed 1 year ago
Hi @esdccs1 thanks for opening this issue, have you tried the following depends_on
?:
depends_on = [module.virtual_machine]
I will try that, I had provisoned two VMs in an availability set then referenced each one inside the endpoints block as such, but perhaps that wasnt enough for terraform to infer it needed to wait for other stuff inside module to finish
resource "azurerm_network_connection_monitor" "my_connection_mon" {
name = "Monitor"
network_watcher_id = var.network_watcher_id
location = local.location
endpoint {
name = "source-1"
target_resource_id = module.virtual_machine["1"].vm_id
}
endpoint {
name = "source-2"
target_resource_id = module.virtual_machine["2"].vm_id
}
dynamic "endpoint" {
for_each = var.sites
content {
name = "destination-${endpoint.value.name}"
address = endpoint.value.fqdn
}
}
test_configuration {
name = "my-test-config"
protocol = "Http"
test_frequency_in_seconds = 30
http_configuration {
port = 443
}
}
test_group {
name = "my-test-group"
destination_endpoints = [for entry in var.sites: "destination-${entry.name}"]
source_endpoints = ["source-1"]
test_configuration_names = ["HTTPTestConfig"]
}
test_group {
name = "my-test-group"
destination_endpoints = [for entry in var.sites: "destination-${entry.name}"]
source_endpoints = ["source-2"]
test_configuration_names = ["HTTPTestConfig"]
}
output_workspace_resource_ids = [data.azurerm_log_analytics_workspace.my_law.id]
}
@lonegunmanb I added the entire module as dependency and that resolved the problem, thank you for your prompt reply
resource "azurerm_network_connection_monitor" "my_connection_mon" {
depends_on = [module.virtual_machine]
...
Is there an existing issue for this?
Description
When installing network_watcher extension,
I have an azure connection monitor resource that I later use with the VM.
somtimes when I provision the vm using this module, the
azurerm_network_connection_monitor
that depends ont hsi module then fails and says the underlying network_watcher extension isn't installed yetexample failur:
Not sure how to solve this, whether a flag saying 'wait for all things to finish' , or exposing an array inthe outputs to all the extension objects.
For now I have used external extension resources, and added an explicit dependency on my conection monitors
New or Affected Resource(s)/Data Source(s)
azurerm_network_connection_monitor
Potential Terraform Configuration
No response
References
No response