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 attach aws_wafregional_rule_group #4414

Closed
dynamike opened this issue May 1, 2018 · 3 comments
Closed

Unable to attach aws_wafregional_rule_group #4414

dynamike opened this issue May 1, 2018 · 3 comments
Labels
bug Addresses a defect in current functionality. service/waf Issues and PRs that pertain to the waf service.
Milestone

Comments

@dynamike
Copy link

dynamike commented May 1, 2018

Terraform Version

Terraform v0.11.7
+ provider.aws v1.16.0

Affected Resource(s)

  • aws_wafregional_web_acl
  • aws_wafregional_rule_group

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
resource "aws_wafregional_rule" "example" {
  name        = "example"
  metric_name = "example"
}

resource "aws_wafregional_rule_group" "example" {
  name        = "example"
  metric_name = "example"

  activated_rule {
    action {
      type = "COUNT"
    }

    priority = 1
    rule_id  = "${aws_wafregional_rule.example.id}"
  }
}

resource "aws_wafregional_web_acl" "example" {
  name = "example"

  # CloudWatch metrics naming requirements:
  # 1 and 128 alphabetic characters long.
  # Don't include numbers, spaces, or special characters.
  metric_name = "example"

  default_action {
    type = "ALLOW"
  }

  rule {
    action {
      type = "BLOCK"
    }

    priority = 1
    rule_id  = "${aws_wafregional_rule_group.example.id}"
  }
}
provider "aws" {
  version = "~> 1.16.0"
  region  = "us-west-2"
}
terraform {
  required_version = "~> 0.11.3"
}

Debug Output

terraform apply output -- https://gist.github.com/dynamike/2c2dd59db19c380f09edba8e0db25686

Expected Behavior

The aws_wafregional_rule_group should attach to the aws_wafregional_web_acl

Actual Behavior

It's unable to find the rule group id
* aws_wafregional_web_acl.example: Error Updating WAF Regional ACL: Error Updating WAF Regional ACL: WAFNonexistentItemException: The referenced item does not exist.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply --auto-approve
@dynamike dynamike changed the title Unable to attach a aws_wafregional_rule_group Unable to attach aws_wafregional_rule_group May 1, 2018
@bflad bflad added bug Addresses a defect in current functionality. service/waf Issues and PRs that pertain to the waf service. labels May 12, 2018
@bflad bflad added this to the v1.27.0 milestone Jul 9, 2018
@bflad
Copy link
Contributor

bflad commented Jul 9, 2018

This should be fixed with #5053 which was just merged into master and will release with version 1.27.0 of the AWS provider, likely middle of this week. 👍

# Implementation is similar for aws_wafregional_web_acl resource
resource "aws_waf_web_acl" "example" {
 # ... other configuration ...
  rules {
    # ... other configuration ...
    override_action {
       type = "NONE"
    }
    type = "GROUP"
    rule_id = "${aws_waf_rule_group.example.id}"
  }
}

@bflad bflad closed this as completed Jul 9, 2018
@bflad
Copy link
Contributor

bflad commented Jul 11, 2018

This has been released in version 1.27.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 4, 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. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/waf Issues and PRs that pertain to the waf service.
Projects
None yet
Development

No branches or pull requests

2 participants