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

azurerm_virtual_machine: make the vm_size property case insensitive #1073

Closed
ghost opened this issue Apr 5, 2018 · 7 comments
Closed

azurerm_virtual_machine: make the vm_size property case insensitive #1073

ghost opened this issue Apr 5, 2018 · 7 comments

Comments

@ghost
Copy link

ghost commented Apr 5, 2018

This issue was originally opened by @rohrerb as hashicorp/terraform#17757. It was migrated here as a result of the provider split. The original body of the issue is below.


Hello,

We often run into case issues with Azure RM Provider and we are forced to use ignore_changes under life cycle . We often see issues with VM Size, we may use Standard_DS12_v2 and that works for creation. When we then do another plan it wants to resize the vm because it sees the size as Standard_DS12_V2.

It would nice to have a ignore_casing under life cycle that we can leverage to ignore any case difference. We can use ignore changes, but we honestly want to know if the VM size has changed.

***We see this on many other fields as well, but vm size and other resource names are the ones that hit us the most. It would be easier to just ignore casing than to keep having to remove / re-add state over and over again.

-Thank you

@katbyte
Copy link
Collaborator

katbyte commented Apr 5, 2018

Hello @rohrerb,

This is a common issue in the azure provider. Many of the fields are case insensitive but because terraform defaults to case sensitive we need to specifically have them ignore case.

If you can provide a list of fields that should be case insensitive it wouldn't take to much effort to switch them to ignore case.

@rohrerb
Copy link
Contributor

rohrerb commented Apr 6, 2018

The two that haunt us are ResourceGroup and VM Size.

Thank you

@katbyte
Copy link
Collaborator

katbyte commented Apr 13, 2018

Hi @rohrerb,

I took a closer look at this today and I am on the wrong track for these properties, they do not have the issue I was thinking of.

I checked the vm_size property of azurerm_virtual_machine and if I use the same casing everywhere in my terraform it doesn't prompt to modify on plan. However if I change it in the portal or by other means, it is set the the 'standard' strings used by the SDK/API that can be seen here here. If you use these in your terraform you may no longer have to worry about casing for this property. As a side note we will probably eventually check this field to validate the string supplied matches the SDK.

With respect to resource groups, in some API's they are case sensitive, in some they are not. However if you use the same case everywhere in your terraform you should not be being prompted to modify any resources on plan.

Please don't hesitate to let me know if this advice doesn't help 🙂

@clangaxon
Copy link

It does seem to be a mix of portal/tf usage that inflicts this, but that doesn't seem like a good reason not to fix it? :)

@tombuildsstuff
Copy link
Contributor

@clangaxon Terraform as a whole is case-sensitive - the Azure Provider's a little more lenient due to Azure being inconsistent in some places; that said I think the solution here is to be consistent internally with how we represent fields.

As @katbyte has mentioned, Resource Group names are generally case sensitive - as such Terraform should be requiring users to match the casing (as it's doing). In this instance we could probably make the VM Size field case insensitive since it's case-insensitive within Azure (at least, in all the API endpoints that I'm aware of).

Given other Providers API's can be case sensitive - we have no plans to introduce an ignore_casing attribute within Terraform at this time. I'm going to rename this issue to "azurerm_virtual_machine: make the vm_size property case insensitive" to update the focus of this issue, which should resolve this issue.

Thanks!

@tombuildsstuff tombuildsstuff changed the title New lifecycle attribute called ignore_casing azurerm_virtual_machine: make thevm_size` property case insensitive Apr 16, 2018
@tombuildsstuff tombuildsstuff changed the title azurerm_virtual_machine: make thevm_size` property case insensitive azurerm_virtual_machine: make the vm_size property case insensitive Apr 16, 2018
@tombuildsstuff tombuildsstuff added this to the Future milestone Apr 16, 2018
@clangaxon
Copy link

I haven't experienced resource group names requiring a case-sensitive match before - perhaps someone from Microsoft can chime in?

I'd prefer it was fixed without resorting to a new attribute anyway - it seems like this is something that should 'just work' in accordance with the Azure APIs.

Thanks!

@ghost
Copy link
Author

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

No branches or pull requests

4 participants