Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing Resource ID - ID contained more segments than required #7005

Closed
dmitri0s opened this issue May 19, 2020 · 3 comments
Closed

Error parsing Resource ID - ID contained more segments than required #7005

dmitri0s opened this issue May 19, 2020 · 3 comments
Labels

Comments

@dmitri0s
Copy link

dmitri0s commented May 19, 2020

provider "azurerm"{
  version = "=2.10.0"
}
$ terraform import azurerm_resource_group.xxxxx /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxx-xxx-xxx-xxxxxx/providers/Microsoft.Storage/storageAccounts/xxxxxxxxxxxxxxxx

Error: Error parsing Resource ID "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxx-xxx-xxx-xxxxxx/providers/Microsoft.Storage/storageAccounts/xxxxxxxxxxxxxxxx": ID contained more segments than required: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxx-xxx-xxx-xxxxxx/providers/Microsoft.Storage/storageAccounts/xxxxxxxxxxxxxxxx"

Apparently this should've been fixed since version 2.1.0 of the provider as per #5998 however appears to be not! Please help.

EDIT: Also not working for provider "azurerm" (hashicorp/azurerm) 2.1.0 - so must be unrelated.

@tombuildsstuff
Copy link
Member

tombuildsstuff commented May 19, 2020

hi @dmitri-o

Thanks for opening this issue

Terraform requires that you use the Resource ID for the specific Resource that's being imported - in this instance, the Resource ID of an Resource Group - whereas it appears that the Resource ID for a Storage Account is being used, which is why Terraform is returning this error.

Instead you should be able to use the ID of the Resource Group, namely:

$ terraform import azurerm_resource_group.xxxxx /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxx-xxx-xxx-xxxxxx

Rather than the ID of the Storage Account and this import should work - would you be able to take a look? Since this should be fixed by updating the Resource ID being used, I'm going to close this issue for the moment.

Thanks!

@dmitri0s
Copy link
Author

hi @tombuildsstuff thanks so much for explaining this, I apologise for raising this as an issue, got my wires crossed somehow. Thank you.

@ghost
Copy link

ghost commented Jun 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants