简体   繁体   中英

terraform throwing “invalid or unknown key: zones” when creating azure vm

i am using a key called "zones" while creating an azure vm using the resource "azurerm_virtual_machine". I am using terraform version 0.11.13. According to the docs, "zones" key is allowed. https://www.terraform.io/docs/providers/azurerm/r/virtual_machine.html

But when i run "terraform plan", i see the following error: Error: azurerm_virtual_machine.testVM[4]: : invalid or unknown key: zones

Verified if i am using the key "zones" for the correct resource type and it looks okay according to hashicorp docs

resource "azurerm_virtual_machine" "testVM" {
  <code to create VM>
  zones                         = ["1"]
}

you need to update your azurerm provider to the latest version. this is not something terraform handles directly, resource provider does that. I think you could do that by deleting the "internal" tf folder and running tf init .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM