You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.
/*************************************************************************************************************************************************************** CHAOS STUDIO SECTION/**************************************************************************************************************************************************************//******************************************************************************* REGISTER AZURE CHAOS PROVIDER*******************************************************************************/resource"null_resource""register_chaos_provider" {
provisioner"local-exec" {
command="az provider register --namespace Microsoft.Chaos"
}
# Ensure this runs only once by using a triggertriggers={
always_run ="${timestamp()}"
}
}
/******************************************************************************** CREATE SERVICE PRINCIPAL********************************************************************************/resource"azuread_application""cs_app" {
display_name="chaos-studio-sp"
}
resource"azuread_service_principal""cs_sp" {
client_id=azuread_application.cs_app.client_iduse_existing=true
}
resource"azuread_service_principal_password""cs_sp_pw" {
service_principal_id=azuread_service_principal.cs_sp.idend_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.valuesensitive=true
}
/******************************************************************************** SERVICE PRINCIPAL ROLES********************************************************************************/resource"azurerm_role_assignment""chaos_contributor_sp" {
principal_id=azuread_service_principal.cs_sp.idrole_definition_name="Chaos Contributor"scope=azurerm_resource_group.uks.id#scope = data.azurerm_subscription.primary.id
}
# resource "azurerm_role_assignment" "vm_reader" {# principal_id = azuread_service_principal.example.id# role_definition_name = "Reader"# scope = azurerm_windows_virtual_machine.uks-vmsa[0].id # Replace with your VM's ID# }/******************************************************************************** ADD AGENT-BASED TARGETS TO CHAOS STUDIO********************************************************************************/resource"azurerm_chaos_studio_target""tgt-uks_vmsa" {
count=var.servercountalocation=azurerm_resource_group.uks.locationtarget_resource_id=azurerm_windows_virtual_machine.uks-vmsa[count.index].idtarget_type="Microsoft-Agent"
}
# resource "azurerm_chaos_studio_target" "tgt-uks_vmsa_1" {# location = azurerm_resource_group.uks.location# target_resource_id = azurerm_windows_virtual_machine.uks-vmsa[1].id# target_type = "Microsoft-Agent"# }# resource "azurerm_chaos_studio_target" "tgt-uks_vmsa_2" {# location = azurerm_resource_group.uks.location# target_resource_id = azurerm_windows_virtual_machine.uks-vmsa[2].id# target_type = "Microsoft-Agent"# }/******************************************************************************** ADD SERVICE-BASED TARGETS TO CHAOS STUDIO********************************************************************************/resource"azurerm_chaos_studio_target""tgt-key_vault_target" {
location=azurerm_resource_group.uks.locationtarget_resource_id=azurerm_key_vault.kv1.idtarget_type="Microsoft-Service"
}
resource"azurerm_chaos_studio_target""tgt-app_service_target" {
location=azurerm_resource_group.uks.locationtarget_resource_id=azurerm_service_plan.uks-asp.idtarget_type="Microsoft-Service"
}
/******************************************************************************** ADD CHAOS STUDIO CAPABILITIES********************************************************************************/resource"azurerm_chaos_studio_capability""cap_net_disconnect" {
count=var.servercountacapability_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.servercountacapability_type="CPUPressure-1.0"chaos_studio_target_id=azurerm_chaos_studio_target.tgt-uks_vmsa[count.index].id
}
Debug Output/Panic 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.
Actual Behaviour
Terraform apply timeouts after 30 minutes, citing the context deadline has exceeded. This occurs regardless how long you set the deadline for, and the target and capability azurerm resources are not created.
Steps to Reproduce
terraform apply
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered:
Thanks for raising this issue. Seems the List API to retrieve target types would time out. The issue Azure/azure-rest-api-specs#30673 is filed for tracking.
Is there an existing issue for this?
Community Note
Terraform Version
1.9.5
AzureRM Provider Version
4.0.1
Affected Resource(s)/Data Source(s)
azurerm_chaos_studio_capability, azurerm_chaos_studio_target
Terraform Configuration Files
Debug Output/Panic Output
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.
Actual Behaviour
Terraform apply timeouts after 30 minutes, citing the context deadline has exceeded. This occurs regardless how long you set the deadline for, and the target and capability azurerm resources are not created.
Steps to Reproduce
terraform apply
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: