Debug Output
`Error: retrieving list of chaos target types: loading results: Get "": context deadline exceeded
with azurerm_chaos_studio_target.tgt-uks_vmsa[0],
on main.tf line 1453, in resource "azurerm_chaos_studio_target" "tgt-uks_vmsa":
1453: resource "azurerm_chaos_studio_target" "tgt-uks_vmsa" {
retrieving list of chaos target types: loading results: Get "": context deadline exceeded
Error: retrieving list of chaos target types: loading results: Get "": context deadline exceeded
with azurerm_chaos_studio_target.tgt-key_vault_target,
on main.tf line 1475, in resource "azurerm_chaos_studio_target" "tgt-key_vault_target":
1475: resource "azurerm_chaos_studio_target" "tgt-key_vault_target" {
retrieving list of chaos target types: loading results: Get "": context deadline exceeded
Error: retrieving list of chaos target types: loading results: Get "": context deadline exceeded
with azurerm_chaos_studio_target.tgt-app_service_target,
on main.tf line 1481, in resource "azurerm_chaos_studio_target" "tgt-app_service_target":
1481: resource "azurerm_chaos_studio_target" "tgt-app_service_target" {
retrieving list of chaos target types: loading results: Get "": context deadline exceeded`
Expected Behaviour
The Chaos Studio target and capability azurerm resources should be created as the Microsoft.Chaos resource provider is registered in the target subscription and the same resources can be created with the same configuration through azapi provider.
Actual Behaviour
Terraform apply timeouts after 30 minutes saying it couldn't get the list of chaos capability types/target types.
Steps to Reproduce
terraform apply
Important Factoids
No response
References
I've attached a tfapplyCS2.txt file to show the apply.
tfapplyCS2.txt
Terraform Version 1.9.5
AzureRM Provider Version 3.116.0
Affected Resource(s)/Data Source(s) azurerm_chaos_studio_target, azurerm_chaos_studio_capability
Terraform Configuration Files `
resource "null_resource" "register_chaos_provider" { provisioner "local-exec" { command = "az provider register --namespace Microsoft.Chaos" }
/ Ensure this runs only once by using a trigger/ triggers = { always_run = "${timestamp()}" } }
resource "azuread_application" "cs_app" { display_name = "chaos-studio-sp" }
resource "azuread_service_principal" "cs_sp" { client_id = azuread_application.cs_app.client_id use_existing = true }
resource "azuread_service_principal_password" "cs_sp_pw" { service_principal_id = azuread_service_principal.cs_sp.id end_date = local.expiration_date }
output "client_id" { value = azuread_service_principal.cs_sp.client_id } output "client_secret" { value = azuread_service_principal_password.cs_sp_pw.value sensitive = true }
resource "azurerm_role_assignment" "chaos_contributor_sp" { principal_id = azuread_service_principal.cs_sp.id role_definition_name = "Chaos Contributor" scope = azurerm_resource_group.uks.id
scope = data.azurerm_subscription.primary.id
}
resource "azurerm_chaos_studio_target" "tgt-uks_vmsa" { count = var.servercounta location = azurerm_resource_group.uks.location target_resource_id = azurerm_windows_virtual_machine.uks-vmsa[count.index].id target_type = "Microsoft-Agent" }
resource "azurerm_chaos_studio_target" "tgt-key_vault_target" { location = azurerm_resource_group.uks.location target_resource_id = azurerm_key_vault.kv1.id target_type = "Microsoft-Service" }
resource "azurerm_chaos_studio_target" "tgt-app_service_target" { location = azurerm_resource_group.uks.location target_resource_id = azurerm_service_plan.uks-asp.id target_type = "Microsoft-Service" }
resource "azurerm_chaos_studio_capability" "cap_net_disconnect" { count = var.servercounta capability_type = "NetworkDisconnect-1.1" chaos_studio_target_id = azurerm_chaos_studio_target.tgt-uks_vmsa[count.index].id }
resource "azurerm_chaos_studio_capability" "cap_cpupressure" { count = var.servercounta capability_type = "CPUPressure-1.0" chaos_studio_target_id = azurerm_chaos_studio_target.tgt-uks_vmsa[count.index].id }
`
Debug Output `Error: retrieving list of chaos target types: loading results: Get "": context deadline exceeded
with azurerm_chaos_studio_target.tgt-uks_vmsa[0], on main.tf line 1453, in resource "azurerm_chaos_studio_target" "tgt-uks_vmsa": 1453: resource "azurerm_chaos_studio_target" "tgt-uks_vmsa" {
retrieving list of chaos target types: loading results: Get "": context deadline exceeded
Error: retrieving list of chaos target types: loading results: Get "": context deadline exceeded
with azurerm_chaos_studio_target.tgt-key_vault_target, on main.tf line 1475, in resource "azurerm_chaos_studio_target" "tgt-key_vault_target": 1475: resource "azurerm_chaos_studio_target" "tgt-key_vault_target" {
retrieving list of chaos target types: loading results: Get "": context deadline exceeded
Error: retrieving list of chaos target types: loading results: Get "": context deadline exceeded
with azurerm_chaos_studio_target.tgt-app_service_target, on main.tf line 1481, in resource "azurerm_chaos_studio_target" "tgt-app_service_target": 1481: resource "azurerm_chaos_studio_target" "tgt-app_service_target" {
retrieving list of chaos target types: loading results: Get "": context deadline exceeded`
Expected Behaviour The Chaos Studio target and capability azurerm resources should be created as the Microsoft.Chaos resource provider is registered in the target subscription and the same resources can be created with the same configuration through azapi provider.
Actual Behaviour Terraform apply timeouts after 30 minutes saying it couldn't get the list of chaos capability types/target types.
Steps to Reproduce terraform apply
Important Factoids No response
References I've attached a tfapplyCS2.txt file to show the apply. tfapplyCS2.txt