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

resourcegroups Should be resourceGroups #20386

Closed
wants to merge 1 commit into from
Closed

resourcegroups Should be resourceGroups #20386

wants to merge 1 commit into from

Conversation

greatbody
Copy link

Why this PR

While I am working on my project, I noticed that the terraform state I imported from Azure is not correct.

The "resourcegroups" string lies in the scope parameter, while the correct one should be "resourceGroup".

@tombuildsstuff
Copy link
Contributor

hey @greatbody

Thanks for this PR.

Taking a look through here since this is changing the generated code from the Azure SDK for Go unfortunately we're unable to accept this change, since these files are vendored from the Azure SDK such that the change would instead need to be made in the Azure SDK for Go repository (or rather, the Azure/azure-rest-api-specs repository that it's generated from).

I've recently opened #20387 which switches this SDK from using Azure/azure-sdk-for-go to using hashicorp/go-azure-sdk, which is also generated from the Swagger - but instead requires the casing matches resourceGroups.

However in both SDKs we're not using this method - instead we're splitting the Resource ID into Scope and the Lock Name and then using the ByScope methods - meaning we use the user-provided Scope as this value, so unfortunately changing this method in the SDK won't have the desired effect here.

Based on the description/change you're proposing here, it sounds like you've imported this resource in a different casing, which is being flagged as a diff - in this case I'd recommend using terraform state rm (to remove the resource from your state file) and terraform import (to re-import this resource) using resourceGroups rather than resourcegroups, which should solve this - would you be able to take a look and see if that works for you?

However since this PR is changing a function in the upstream/vendored Azure SDK for Go (and isn't the method we're using) - whilst I'd like to thank you for this contribution, I'm going to close this PR for the moment.

Thanks!

@greatbody
Copy link
Author

Thank you for your details response.

Respect.

@greatbody
Copy link
Author

I think you are right. I checked the import command, and the id while I import is lowcase.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants