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

Fix case sensitivity issues for dns resources after importing existing records #5455

Closed
jknash opened this issue Jan 20, 2020 · 3 comments
Closed
Labels

Comments

@jknash
Copy link
Contributor

jknash commented Jan 20, 2020

I recently imported our public DNS zones into my Terraform state. Now when I run terraform plan, it wants to re-create all of my records because the resource group name is uppercase on the resource group, but apparently lowercase on the DNS records. I’m ignoring resource_group_name in my lifecycle settings, but that isn’t an optimal solution.

I'm not sure if this is a provider issue, BUT when I create a resource group in a region in the portal, I can't create one with a name that already exists, regardless of case. So the portal must have functionality to ignore case, even when the API is case sensitive? Any chance the provider can be modified to ignore case unless it is absolutely necessary?

@tombuildsstuff
Copy link
Contributor

hi @jknash

Thanks for opening this issue.

Whilst the Azure API Specification states that Resource ID's are Case Insensitive - in practice across many API's they're not - which is a frequent source of subtle bugs. This means that we're forced to treat Resource ID's (and thus the components which comprise them) as case-sensitive unfortunately this behaviour is intentional - as such we don't plan to make the provider case-insensitive (this mirrors the behaviour of other Terraform Providers, which are case sensitive too).

Given this behaviour is intentional unfortunately this isn't something we plan to fix directly - however we could instead look to add validation to the DNS resources to ensure that the correct casing is used if that'd be helpful? Since this is a question rather than a bug in the Azure Provider I'm going to close this issue for the moment - however please let us know if you'd be interested in validation for the DNS Resources and we can take a look/open a new issue to track that.

Thanks!

@jknash
Copy link
Contributor Author

jknash commented Jan 21, 2020

I think it would be helpful in general to have validation built in for case sensitivity. I'm not sure how it would work in the provider, but it would be nice to have a mechanism in place that throws an error if the case in the .tf file doesn't match what is configured in the API. In this instance, it is the resource group name. In reading up on the issue, I did seem to find other resources affected, so would it be possible to do this for all resources in the provider?

@ghost
Copy link

ghost commented Mar 28, 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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 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