Open johnwildes opened 4 years ago
it seems an issue of azure api that tags will be omitted when the key contains :
In this deployment, the tags are being applied to other resources within this deployment, including the :
within the tag name. It's only these azurerm_private_dns_zone
resources that the tags are not applying on.
Are you saying it's the Azure API for the private dns zone resource that is not applying tags with :
?
I was able to replicate this, and it does seem to involve the ':'. For example, adding a tag of '"key:1" = "value"' works for the azurerm_resource_group resource, but not for azurerm_private_dns_zone resource. This can also be verified through the Azure UI and it actually hangs when trying to add a tag with a ':' to a private DNS zone.
I am looking do something similar to this. Add tags to DNS Zones with ":" Is there any way to achieve this?
@njuCZ since this appears to be an API bug, can you raise an API issue to track this?
We have noticed this issue as well when the key contains a space.
For example:
"Data Classification" = "Internal Use Only"
"Maintenance Window" = "None"
Those show up in our Terraform plan to be added each time, but they are never added to the resource.
We noticed this issue when tag key contains a space, show up in Terraform plan to be added each time, but they are never getting added to the resource. We see this issue for following resources:
azurerm_dns_a_record azurerm_dns_ns_record azurerm_dns_txt_record azurerm_dns_zone
Experiencing this issue on private DNS zone and Virtual network links where a space in the name prevents the tag from applying.
With hashicorp/azurerm v3.8.0, tags where the name does NOT contain a space work just fine, also for these DNS resources.
With spaces, there are issues. Not only with azurerm_dns_*
, but also elsewhere.
Because of this, we changed to using _
(underscore) instead of
(space). Not nice, but that's what's working for us.
Any update on this? I also require tags that contain colon namespacing.
This still appears to be an issue as of 3.64.0
and in addition to the above resource types, also seems to affect azurerm_private_dns_zone_virtual_network_link
.
Also appears to be the case with vm extensions, at least for arc enabled resources.
I'm seeing what I suspect is a symptom of this due to Azure Policy and my organization's tagging requirements -- I'm unable to create a private AKS cluster because the tags from the cluster are not making it to the azure-managed virtual network link resource and the policy is preventing that link from being created which fails the cluster creation.
My tags names have hyphens instead of spaces or colons, but some of my tag values do have spaces. The previous comments have indicated spaces and colons in the name are problematic, so it would be helpful for me and anyone else seeing my issue if anyone could confirm the below:
Thanks in advance
We opened a support case with MS for this and they advised that my issue is due to a lack of support to pass the same tags from the parent onto the child, on their end. They said the support should come in the February 2024 releases. For now, we excluded the network link resources from the tagging policy.
Hi,
Any update on this? I also require tags that contain colon namespacing into private DNS Zone.
Thanks,
I can confirm that the issue still persists. Tags with colons or spaces are not working.
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.12.23
Affected Resource(s)
azurerm_private_dns_zone
Terraform Configuration Files
Debug Output
NO Panic was created, no
crash.log
created, no debug output to attachTerraform Plan Ouptut (Reduced for clarity, only showing one resource)
You can see from the plan output above that it is trying to add tags to the resource. cd
Terraform Apply Output
Expected Behavior
Tags should be applied after
terraform apply
is run.Actual Behavior
Tags are not applied, but no error is displayed. TF Apply completes normally but the resource has no tags
Steps to Reproduce
terraform apply
tags
are added to the resourceapply
to see that there are no errors, and that resources are changedterraform apply
and see thatazurerm_private_dns_zone
will apply tags again.Important Factoids
Nothing significant about this environment
References