I'm trying to import state from Azure via Terraform and save the state to a resource with indexes, such as:
terraform import azurerm_subnet.test_subnets["test-subnet-1"] /subscriptions/xxxxxx-xxx-xxx-xxxxx/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-subnet-1
I read other threads that say I have to escape the quotation marks, so I did. Even though the quotes are escaped, it seems as though the Terraform compiler is still pulling the quotations out and leaving the
characters in place.
Here's the error output that I'm seeing:
Error: Invalid character
on <import-address> line 1:
1: azurerm_subnet.test_subnets[est-subnet-1]
This character is not used within the language.
Error: Index value required
on <import-address> line 1:
1: azurerm_subnet.test_subnets[est-subnet-1]
Index brackets must contain either a literal number or a literal string.
Error: Invalid character
on <import-address> line 1:
1: azurerm_subnet.test_subnets[est-subnet-1]
This character is not used within the language.
For information on valid syntax, see:
https://www.terraform.io/docs/internals/resource-addressing.html
Any thoughts here? Am I doing something wrong or is this a known limitation of the application?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…