jason-johnson / azure-pipelines-tasks-terraform

Azure Pipelines extension for Terraform
MIT License
121 stars 52 forks source link

Terraform CLI in Azure Devops does not allow to target a resource with double quotes #341

Open intoinr opened 1 year ago

intoinr commented 1 year ago

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