azurerm_traffic_manager_profileazurerm_traffic_manager_endpoint# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp
resource "azurerm_traffic_manager_profile" "api" {
name = "my-api"
resource_group_name = var.resource_group_name
traffic_routing_method = "Priority"
dns_config {
relative_name = "my-api.example.com"
ttl = 15
}
monitor_config {
protocol = "https"
port = 443
path = "/health"
interval_in_seconds = 30
timeout_in_seconds = 5
tolerated_number_of_failures = 3
expected_status_code_ranges = ["100-403"]
}
}
resource "azurerm_traffic_manager_endpoint" "api_blue_endpoint" {
name = "my-api-blue"
resource_group_name = var.resource_group_name
profile_name = azurerm_traffic_manager_profile.api.name
target_resource_id = var.blue_ip_resource_id
type = "azureEndpoints"
priority = 10
endpoint_status = var.enable_blue == true ? "Enabled" : "Disabled"
custom_header {
name = "Host"
value = "my-apu."
}
}
Changes to values in the azurerm_traffic_manager_profile should not affect the azurerm_traffic_manager_endpoint.
Changes to values in the azurerm_traffic_manager_profile like monitor_config.path or dns_config.ttl causes all the azurerm_traffic_manager_endpoint to disappear. You basically have to run terraform twice to reprovision them.
terraform applymonitor_config.path from /health to /healthz.terraform applyYour endpoints are now gone.
Seeing the same thing here... doing any change to the profiles wipes the endpoints...
@katbyte / @tombuildsstuff how we do normally proceed with this type of debugging ? From what I can gather, it seems that something changed at the MSFT side maybe ? assuming this was never an issue before ?
We just caused major downtime by changing a simple monitor setting since it wiped ALL endpoints.
I looked at the terraform code and the traffic_manager_profiles resource doesn't set any endpoints. The model can receives a list, but instead terraform uses the azurerm_traffic_manager_endpoint resource.
So... how is this normally reported to MSFT, knowing that making changes in the portal or AZ CLI doesn't affect it seems...
We also kicked ourselves in the nuts with this bug trying to apply a simple change in resource tags. Does anyone have an update on this?
I've created a pull request with a fix: https://github.com/terraform-providers/terraform-provider-azurerm/pull/7471 . It was attached to a closed/duplicate issue so I'm mentioning it here to make sure it's seen.
@nitzanm / @ArcturusZhang which of the two PR should I follow to know when this is ready ?
@katbyte I see you are reviewing #7846 , should we expect this in 2.21.0 ? :)
This has been released in version 2.23.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:
provider "azurerm" {
version = "~> 2.23.0"
}
# ... other configuration ...
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
We also kicked ourselves in the nuts with this bug trying to apply a simple change in resource tags. Does anyone have an update on this?