-
|
I think this might be a limitation of the HCL parser, but when I have tf code like this resource "azurerm_dns_zone" "mydomain_com_zone" {
resource_group_name = var.resource_group_name
name = "mydomain.com"
lifecycle {
ignore_changes = [tags]
}
}I am struggling to create a rule to enforce that ignore_changes = [tags] must exist. The best I can manage is this rule which passes when I wrap tags in the double quotations lifecycle {
ignore_changes = ["tags"]
}
,but @wata727 is there a way to write a rego rule to enforce |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Ah, good question. Because the There are several possible solutions, for example introducing a function like |
Beta Was this translation helpful? Give feedback.
Ah, good question. Because the
terraform.resourcesfunction evaluates attributes as values, there is currently no way to handle special attributes like theignore_changes. This is a limitation of theterraform.resourcesfunction rather than a limitation of the HCL parser.There are several possible solutions, for example introducing a function like
terraform.resources_meta_arguments. I am positive about solving this issue.