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

[Bug]: challenge not supported action in aws_wafv2_rule_group, though docs indicate it is #29229

Closed
stevenwilliamson opened this issue Feb 3, 2023 · 6 comments · Fixed by #29690
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/wafv2 Issues and PRs that pertain to the wafv2 service.
Milestone

Comments

@stevenwilliamson
Copy link

stevenwilliamson commented Feb 3, 2023

Terraform Core Version

v1.3.7

AWS Provider Version

v4.53.0

Affected Resource(s)

aws_wafv2_rule_group

Expected Behavior

The action block in a rule should support the challenge action as documented in the docs https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl.html#challenge

Actual Behavior

Error reported that challenge block not expected

Error: Unsupported block type

│ on test.tf line 279, in resource "aws_wafv2_rule_group" "test":
│ 279: challenge {}

│ Blocks of type "challenge" are not expected here.

Changing the action type to captcha does work, and allows terraform to create the rule.

Creating the rule with action type captcha i can then change the action in the AWS console to challenge and the rule works as expected.

Relevant Error/Panic Output Snippet

Error: Unsupported block type
│ 
│   on test.tf line 279, in resource "aws_wafv2_rule_group" "test":
│  279:       challenge {}
│ 
│ Blocks of type "challenge" are not expected here.

Terraform Configuration Files

Example rule

rule {
    name     = "test"
    priority = 41

    rule_label {
      name = "test"
    }
    action {
      challenge {}
    }

    statement {
      not_statement {
        statement {
          geo_match_statement {
            country_codes = [
              "US", # USA
            ]
          }
        }
      }
    }

    visibility_config {
      cloudwatch_metrics_enabled = false
      metric_name                = "test"
      sampled_requests_enabled   = false
    }
  }

Steps to Reproduce

Attempt to create a rule group with a rule that uses the challenge action.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

@stevenwilliamson stevenwilliamson added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Feb 3, 2023
@github-actions
Copy link

github-actions bot commented Feb 3, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/wafv2 Issues and PRs that pertain to the wafv2 service. label Feb 3, 2023
@stevenwilliamson stevenwilliamson changed the title [Bug]: challenge not supported action in aws_wafv2_web_acl, though docs indicate it is [Bug]: challenge not supported action in aws_wafv2_rule_group, though docs indicate it is Feb 3, 2023
@stevenwilliamson
Copy link
Author

To follow up on this report i have just realised this is an inconsistency.

aws_wafv2_web_acl resource rules support actions allow, block, count, captcha, challenge

aws_wafv2_rule_group resource rules support allow, block, count, captcha but not challenge

AWS WAF Rule groups do however support the challenge response as it is possible to set this in the AWS console.

@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Feb 6, 2023
@n11c
Copy link
Contributor

n11c commented Mar 2, 2023

Just a heads up for those following this issue: I've made a PR to add support for challenge action to the rule groups

Feel free to add thumbs-up to it to try to get it released soon.

@n11c
Copy link
Contributor

n11c commented Mar 14, 2023

Hey @justinretzolk, is there anything that can be done to get my PR look at for the next release please?

@github-actions github-actions bot added this to the v4.64.0 milestone Apr 20, 2023
@github-actions
Copy link

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/wafv2 Issues and PRs that pertain to the wafv2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants