I’m adding waf configuration to avoid when ever "–BEGIN PUBLIC KEY—" is matching but terraform is throwing error about some required options
name = "example-wafpolicy"
resource_group_name = azurerm_resource_group.rg.name
location = "Global"
custom_rules {
name = "MatchPublicKey"
priority = 1
rule_type = "MatchRule"
action = "Block"
match_conditions {
match_variable = "RequestBody"
operator = "RegexMatch"
match_values = ["--BEGIN PUBLIC KEY---"]
}
}
managed_rules {
managed_rule_set {
version = "1.1"
}
}
}```
```Too few blocks specified for "match_variables": At least 1 block(s) are expected for "match_variables"Terraform
Unexpected attribute: An attribute named "match_variable" is not expected hereTerraform
2
Answers
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_firewall_policy
need follow this doc for the solution.
is the correct resource to use
As per the latest terraform registry you should mention the match_variables within match_conditions and use the variable_name attribute instead of match_variable
Demo configuration:
Deployment:
Refer:
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_firewall_policy