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

"availability_set_id": conflicts with zones #5482

Closed
rohrerb opened this issue Jan 22, 2020 · 4 comments · Fixed by #5550
Closed

"availability_set_id": conflicts with zones #5482

rohrerb opened this issue Jan 22, 2020 · 4 comments · Fixed by #5550

Comments

@rohrerb
Copy link
Contributor

rohrerb commented Jan 22, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Affected Resource(s)

azurerm_virtual_machine

Terraform Configuration Files

  availability_set_id   = local.deploy_using_zones || var.number_of_vms_in_avset == 0 ? "" : element(concat(azurerm_availability_set.av_set.*.id, list("")), 0)
  zones                 = local.deploy_using_zones ? [(each.value.index % var.number_of_zones) + 1] : []

or

  availability_set_id   = "" 
  zones                 = local.deploy_using_zones ? [(each.value.index % var.number_of_zones) + 1] : []

Expected Behavior

Allow both zones and availability_set_id to coexist. availability_set_id will already take a empty string which creates the VM with no AVSET. Zones are not in every region so its important that we have flexibility (without having to VM resources) to deploy a VM in a AVSET or Zones.

Actual Behavior

"availability_set_id": conflicts with zones

Steps to Reproduce

Create a VM resource with availability_set_id = "" and zones = [1]

@tombuildsstuff
Copy link
Contributor

tombuildsstuff commented Jan 22, 2020

hey @rohrerb

Thanks for opening this issue :)

It should be possible to achieve this today by specifyig null rather than an empty string when coalescing - would you be able to take a look and see if that works for you? From our side I'm currently working on the replacement Virtual Machine resources (defined in #2807) for 2.0 - so we'll take a look at this for that release either way 👍

Thanks!

@rohrerb
Copy link
Contributor Author

rohrerb commented Jan 22, 2020

Magic! Thank you @tombuildsstuff that worked. :D

@ghost
Copy link

ghost commented Feb 24, 2020

This has been released in version 2.0.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 = "~> 2.0.0"
}
# ... other configuration ...

@ghost
Copy link

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