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

Add validation to resource_group_name field #228

Closed
tombuildsstuff opened this issue Aug 9, 2017 · 1 comment · Fixed by #330
Closed

Add validation to resource_group_name field #228

tombuildsstuff opened this issue Aug 9, 2017 · 1 comment · Fixed by #330

Comments

@tombuildsstuff
Copy link
Contributor

At the moment we're not applying any validation the resource_group_name field apart from in the azurerm_resource_group resource.

Due to the way URL's are constructed in the Azure API's (by prefixing /subscriptions/{subscription_id}/resourceGroups/{name} to each request) - should the ID of a Resource Group be specified instead of it's Name - Azure will return an error about an Invalid API version (unless we're lucky and both API's have the same version).

This results in the following error:

disk.DisksClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidApiVersionParameter" Message="The api-version '2016-04-30-preview' is invalid. The supported versions are '2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."

We should update the resource_group_name field across all resources to have validation to check this is a Name and not an ID.

Related bugs: #223 Azure/azure-sdk-for-go#706

@ghost
Copy link

ghost commented Apr 1, 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 Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant