Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create custom Azure Application Gateway WAF rule #5354

Closed
darrenk13 opened this issue Jan 9, 2020 · 7 comments · Fixed by #6126
Closed

Unable to create custom Azure Application Gateway WAF rule #5354

darrenk13 opened this issue Jan 9, 2020 · 7 comments · Fixed by #6126

Comments

@darrenk13
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.12.19

  • provider.azurerm v1.40.0

Affected Resource(s)

  • azurerm_web_application_firewall_policy

Terraform Configuration Files

The below code is a subset from the example usage given on the doc page at https://www.terraform.io/docs/providers/azurerm/r/web_application_firewall_policy.html I receive the same error using the full example from that page.

resource "azurerm_resource_group" "example" {
  name     = "example-rg"
  location = "West US 2"
}

resource "azurerm_web_application_firewall_policy" "example" {
  name                = "example-wafpolicy"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location

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

    match_conditions {
      match_variables {
        variable_name = "RemoteAddr"
      }

      operator           = "IPMatch"
      negation_condition = false
      match_values       = ["192.168.1.0/24", "10.0.0.0/24"]
    }

    action = "Block"
  }
}

Debug Output

https://gist.github.com/darrenk13/ff308c5a34378cac9193ba6dc0b5168f

Expected Behavior

Custom Application Gateway WAF rule should have been created.

Actual Behavior

I received an error from Azure and the resource was not created.

Error: Error creating Web Application Firewall Policy "example-wafpolicy" (Resource Group "example-rg"): network.WebApplicationFirewallPoliciesClient#CreateOrUpdate: Invalid input: autorest/validation: validation failed: parameter=parameters.WebApplicationFirewallPolicyPropertiesFormat.ManagedRules constraint=Null value=(*network.ManagedRulesDefinition)(nil) details: value can not be null; required parameter

  on main.tf line 6, in resource "azurerm_web_application_firewall_policy" "example":
   6: resource "azurerm_web_application_firewall_policy" "example" {

Steps to Reproduce

  1. terraform apply

References

@HumanJoubert

This comment has been minimized.

@darrenk13
Copy link
Author

Do we know if this issue has been fixed yet ?

I just checked with the azurerm provider 2.0.0 and I am still seeing the same error message when I try to create this waf policy.

@HumanJoubert

This comment has been minimized.

@robert-kopec

This comment has been minimized.

@sirlatrom
Copy link
Contributor

@robert-kopec Please follow #6126 for progress.

Any further ETA questions on this issue will not help speed up the progress.

@katbyte katbyte added this to the v2.8.0 milestone Apr 26, 2020
@ghost
Copy link

ghost commented May 1, 2020

This has been released in version 2.8.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.8.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented May 26, 2020

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!

@hashicorp hashicorp locked and limited conversation to collaborators May 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants