│ Error: Invalid target "module.azure.azurerm_virtual_network.azure[resource_group1_key]"
│
│ Index brackets must contain either a literal number or a literal string.
╵
╷
│ Error: Invalid target "module.azure.azurerm_virtual_network.azure[virtual_network1_key]"
│
│ Index brackets must contain either a literal number or a literal string.
╵
For more help on using this command, run:
terraform plan -help
[error]Terraform command 'plan' failed with exit code '1'.
[error]╷
│ Error: Invalid target "module.azure.azurerm_resource_group.azure[resource_group1_key]"
│
│ Index brackets must contain either a literal number or a literal string.
╵
╷
│ Error: Invalid target "module.azure.azurerm_resource_group.azure[virtual_network1_key]"
│
│ Index brackets must contain either a literal number or a literal string.
╵
╷
│ Error: Invalid target "module.azure.azurerm_virtual_network.azure[resource_group1_key]"
│
│ Index brackets must contain either a literal number or a literal string.
╵
╷
│ Error: Invalid target "module.azure.azurerm_virtual_network.azure[virtual_network1_key]"
│
│ Index brackets must contain either a literal number or a literal string.
╵
For more help on using this command, run:
terraform plan -help
Finishing: tf plan
Expected behavior
The plan should have run without issues.
Agent Configuration
OS: ubuntu-latest
Hosted
Terraform version used (Default for hosted agent is acceptable) 1.4.6
AzureCLI version used (Default for hosted agent is acceptable or N/A) N/A
Describe the bug Terraform CLI in Azure Devops does not allow to target a resource with double quotes
To Reproduce
Use this task to create a terraform plan:
You will get the following error:
│ Error: Invalid target "module.azure.azurerm_virtual_network.azure[resource_group1_key]" │ │ Index brackets must contain either a literal number or a literal string. ╵ ╷ │ Error: Invalid target "module.azure.azurerm_virtual_network.azure[virtual_network1_key]" │ │ Index brackets must contain either a literal number or a literal string. ╵
For more help on using this command, run: terraform plan -help
[error]Terraform command 'plan' failed with exit code '1'.
[error]╷
│ Error: Invalid target "module.azure.azurerm_resource_group.azure[resource_group1_key]" │ │ Index brackets must contain either a literal number or a literal string. ╵ ╷ │ Error: Invalid target "module.azure.azurerm_resource_group.azure[virtual_network1_key]" │ │ Index brackets must contain either a literal number or a literal string. ╵ ╷ │ Error: Invalid target "module.azure.azurerm_virtual_network.azure[resource_group1_key]" │ │ Index brackets must contain either a literal number or a literal string. ╵ ╷ │ Error: Invalid target "module.azure.azurerm_virtual_network.azure[virtual_network1_key]" │ │ Index brackets must contain either a literal number or a literal string. ╵
For more help on using this command, run: terraform plan -help
Finishing: tf plan
Expected behavior The plan should have run without issues.
Agent Configuration