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

Role Assignment - Treat name as case insensitive #3499

Merged
merged 1 commit into from
May 23, 2019

Conversation

kiall
Copy link
Contributor

@kiall kiall commented May 22, 2019

When the wrong case is used for a role name, e.g. acrpull instead of the
correct AcrPull, azure will accept the request and return the correct
casing. This results in Terraform believing it needs to update the
resource incorrectly.

Example of incorrect behaviour:

-/+ module.aks_simple.module.acr.azurerm_role_assignment.acr_spn_pull_role_assn (new resource required)
      role_definition_name:      "AcrPull" => "acrpull" (forces new resource)

When the wrong case is used for a role name, e.g. acrpull instead of the
correct AcrPull, azure will accept the request and return the correct
casing. This results in Terraform believing it needs to update the
resource incorrectly.
@tombuildsstuff
Copy link
Contributor

hi @kiall

Thanks for opening this PR :)

Case Sensitivity's an interesting problem in Azure (and Terraform) - whilst certain parts of Azure (and the API Specifications) define certain fields (e.g. Resource ID's) as case insensitive - other API's which use that information sometimes require that they're cased correctly.

For this reason whilst historically we've opted to treat some fields as case insensitive - on the whole we're moving towards making the provider case sensitive. As an example, this means that any new fields we add are case-sensitive for both the field value and the validation (which works around these bugs, and also matches the behaviour of other Terraform providers).

That said - in this instance since this field is only used for searching for the role name to obtain it's ID, rather than to be used as a value passed into another service, I think this makes sense (and is a nice UX improvement) - so thanks for this PR 👍🏻

Thanks!

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for this 👍

@tombuildsstuff tombuildsstuff merged commit 794370b into hashicorp:master May 23, 2019
tombuildsstuff added a commit that referenced this pull request May 23, 2019
@ghost
Copy link

ghost commented May 26, 2019

This has been released in version 1.29.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
	version = "~> 1.29.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jun 22, 2019

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 Jun 22, 2019
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