hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.52k stars 4.6k forks source link

azurerm_firewall_policy requires tag keys to be lowercase #9620

Open anderius opened 3 years ago

anderius commented 3 years ago

Community Note

Terraform (and AzureRM Provider) Version

Terraform v0.13.5

Affected Resource(s)

Terraform Configuration Files

resource "azurerm_firewall_policy" "xxxxxx" {
  [...]
  tags =   { Xxxxxxxx = "xxx" }
  )
}

Debug Output

Error: a tag key "Xxxxxxxx" expected to be all in lowercase

  on xxxxxxxx.tf line xx, in resource "azurerm_firewall_policy" "xxxxxxx":
  xx: resource "azurerm_firewall_policy" "xxxxxxx" {

Expected behaviour

Do not require tag keys to be lowercase.

anderius commented 3 years ago

Awaiting fix from Azure team: Azure/azure-rest-api-specs#11899

YbK5730 commented 3 years ago

I am also seeing this for azurerm_data_share_account, not sure if it is related or I need to open a separate issue.

anhlqn commented 3 years ago

Awaiting fix from Azure team: Azure/azure-rest-api-specs#11899

Is there an ETA on this fix?

andyjballgit commented 2 years ago

bump .. just hit this on latest version = v1.0.11

dan-dimitrov commented 2 years ago

bump .... experienced this on terraform version 1.1.5, any update on this?

lotaezhao commented 2 years ago

Experiencing this with v1.1.5 & azurerm v2.94.0

robsoncloud commented 2 years ago

Any hope to release a fix for this bug? Terraform v1.1.5 - azurerm v2.98.0

jakubigla commented 2 years ago

Is there any update on this? This issue has been raised long time ago...

falowomi commented 2 years ago

I encountered the same problem and I was able to fix it using below. tags = tomap({for key, val in var.tags: lower(key)=>lower(val)}) I hope this helps you

asosso commented 2 years ago

Thank you @falowomi.

We could remove lower from the value: tags = tomap({for key, val in var.tags: lower(key)=>val})

wylie-ucb commented 1 year ago

Annoying because Terraform wants to remove the existing tags and replace them with lowercase, even using the workaround above. I added a lifecycle to ignore changes to the tags, and all is good.