Hello Team,
I am having issue with importing the resource which is already created. I checked all the possible option but still having the issue.
I am using the below command based on the plan
terraform import --var-file nonprod.tfvars ‘module.key_vault[“kv01”].azurerm_key_vault.az_vlt’ “/subscriptions/0000000/resourceGroups/xxxxxx-01/providers/Microsoft.KeyVault/vaults/xxxxxxxx”
After that getting below error
no matches found: ‘azurerm_role_assignment.example[kv01]’
Hi @sumitraj0103,
If the message you shared is exactly what Terraform returned then it seems that something has stripped out the quotes from the resource address you specified on the command line.
If you are using PowerShell on Windows then unfortunately it does have a habit of misinterpreting command line arguments like this, so you might have better luck if you use cmd.exe
(Windows Command Prompt) instead.
If you that then you must use the standard conventions for command line escaping on Windows: single quotes aren’t supported, so you will need to write it not in quotes and then use a backslash to escape the two quotes that are part of the resource instance address: \"