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 #7604

Closed
jacoblom opened this issue Jul 7, 2020 · 4 comments
Closed
Labels
question upstream/terraform This issue is blocked on an upstream issue within Terraform (Terraform Core/CLI, The Plugin SDK etc)

Comments

@jacoblom
Copy link

jacoblom commented Jul 7, 2020

provider "azurerm" {
version = "2.17.0"
features {
}
}
$ terraform import azurerm_resource_group.xxxxxxx /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxx

Error: Error parsing Resource ID "C:/Program Files/Git/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxx": ID contained more segments than required: "C:/Program Files/Git/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxx"

Thank you,

This is a duplicate from #7005, but, the #7005 was because of an incorrect resource ID... The resource ID for a storage account ID was mistakenly taken for a resource group ID

@tombuildsstuff tombuildsstuff added question upstream/terraform This issue is blocked on an upstream issue within Terraform (Terraform Core/CLI, The Plugin SDK etc) labels Jul 7, 2020
@tombuildsstuff
Copy link
Member

hi @sjblom

Thanks for opening this issue.

Unfortunately this is a known issue in Terraform Core when using cygwin - where the working directory can be prefixed into arguments as they're passed through. In this case you should be able to quote the ID, or run Terraform from either PowerShell, the Command Prompt (or potentially from within WSL) which should ensure this is interpreted correctly.

Since this is a bug in Terraform Core I'm going to close this issue for the moment - but if one of the suggestions above doesn't work I'd recommend opening an issue on the Terraform Core repository where someone should be able to take a look.

Thanks!

@jacoblom
Copy link
Author

jacoblom commented Jul 7, 2020

Much appreciated @tombuildsstuff

Switched to Powershell, and it worked as expected...

@tombuildsstuff
Copy link
Member

Duplicate of #7604

@tombuildsstuff tombuildsstuff marked this as a duplicate of #7604 Jul 7, 2020
@ghost
Copy link

ghost commented Aug 6, 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!

@hashicorp hashicorp locked and limited conversation to collaborators Aug 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question upstream/terraform This issue is blocked on an upstream issue within Terraform (Terraform Core/CLI, The Plugin SDK etc)
Projects
None yet
Development

No branches or pull requests

2 participants