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.51k stars 4.6k forks source link

Operator 'GeoMatch' for azurerm_web_application_firewall_policy is missing #6581

Closed MaxiPalle closed 4 years ago

MaxiPalle commented 4 years ago

Community Note

Terraform (and AzureRM Provider) Version

Terraform v0.12.24

Affected Resource(s)

Terraform Configuration Files

resource "azurerm_web_application_firewall_policy" "default" {
  name                  = "${var.identifier}-${lower(var.environment)}-gatewaywafdefaultpolicy"
  resource_group_name   = var.rg_name
  location              = var.rg_location

  custom_rules {
    name      = "blockBlacklistedCountries"
    priority  = 1
    rule_type = "MatchRule"

    match_conditions {
      match_variables {
        variable_name = "RemoteAddr"
      }

      operator           = "GeoMatch"
      negation_condition = false
      match_values       = ["AA", "BB", "XY", "YY", "ZZ"]
    }

    action = "Block"
  }
}

Expected behaviour

Custom Application Gateway WAF rule should have been created.

Actual behaviour

Error: expected custom_rules.0.match_conditions.0.operator to be one of [IPMatch Equal Contains LessThan GreaterThan LessThanOrEqual GreaterThanOrEqual BeginsWith EndsWith Regex], got GeoMatch

  on main.tf line 156, in resource "azurerm_web_application_firewall_policy" "default":
 156: resource "azurerm_web_application_firewall_policy" "default" {

Steps to Reproduce

  1. terraform apply

References

https://www.terraform.io/docs/providers/azurerm/r/web_application_firewall_policy.html

boschcrank commented 4 years ago

Here is a one-line PR to fix the issue: https://github.com/terraform-providers/terraform-provider-azurerm/pull/7181

boschcrank commented 4 years ago

I have no idea why this is not closed, but the issue is fixed in v2.14.0.

tombuildsstuff commented 4 years ago

Closing since this has been fixed in v2.14 - thanks for the heads up @boschcrank

ghost commented 3 years ago

I'm going to lock this issue because it has been closed for 30 days โณ. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error ๐Ÿค– ๐Ÿ™‰ , please reach out to my human friends ๐Ÿ‘‰ hashibot-feedback@hashicorp.com. Thanks!