Open SyedAli-180 opened 2 years ago
Hi @SyedAli-180 thanks for opening the issue! There seems to be some issue within the try
function.
For the error The given key does not identify an element in this collection value.
, you may want to check https://discuss.hashicorp.com/t/the-given-key-does-not-identify-an-element-in-this-collection-value/33268/2
And for This object does not have an attribute named "throw_error".
, it seems like each.value
doesn't have a property named throw_error
, you may need to check the properties in each.value
Is there an existing issue for this?
Community Note
│ on .terraform\modules\caf\virtual_machines.tf line 41, in module "virtual_machines": │ 41: boot_diagnostics_storage_account = try(local.combined_diagnostics.storage_accounts[each.value.boot_diagnostics_storage_account_key].primary_blob_endpoint,
│ 42: each.value.boot_diagnostics_storage_account_key == "" ? "" : each.value.throw_error, │ 43: can(tostring(each.value.boot_diagnostics_storage_account_key)) ? each.value.throw_error : null) │ ├──────────────── │ │ each.value is object with 7 attributes │ │ each.value.boot_diagnostics_storage_account_key is "bootdiag_region1gvgfvgfvg" │ │ local.combined_diagnostics.storage_accounts is object with no attributes │ │ Call to function "try" failed: no expression succeeded: │ - Invalid index (at .terraform\modules\caf\virtual_machines.tf:41,85-134) │ The given key does not identify an element in this collection value. │ - Unsupported attribute (at .terraform\modules\caf\virtual_machines.tf:42,76-88) │ This object does not have an attribute named "throw_error". │ - Unsupported attribute (at .terraform\modules\caf\virtual_machines.tf:43,78-90) │ This object does not have an attribute named "throw_error". │ │ At least one expression must produce a successful resul
Terraform Version
1.2.9
AzureRM Provider Version
2.99.0
Affected Resource(s)/Data Source(s)
azurerm_windows_virtual_machine
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
No response
Actual Behaviour
No response
Steps to Reproduce
No response
Important Factoids
No response
References
No response