Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wafv2 webacl cloudformation gets error when I tried to attach the rulegroup I created

I wrote this cloudformation

and it keeps giving me this error

Error reason: A reference in your rule statement is not valid., field: RULE, parameter: Statement (Service: Wafv2, Status Code: 400, Request ID: 8f88058f-556e-4fec-baf2-9a84d0353bbe, Extended Request ID: null)

has anyone seen this error before ? Thank you

      {
        "Name": "Rule",
        "Priority": 1,
        "Action": {
          "Block": {}
        },
        "VisibilityConfig": {
          "SampledRequestsEnabled": true,
          "CloudWatchMetricsEnabled": true,
          "MetricName": "customrule"
        },
       "Statement": {
                        "RuleGroupReferenceStatement": {
                            "Arn": { "Fn::GetAtt" : [ "TestRuleGroup", "Arn" ]
            
          }
        }
      }
    
  }
like image 504
Anita Francis Avatar asked Oct 24 '25 14:10

Anita Francis


1 Answers

you should add below in your code when you reference a rule group The field is needed even if you don't want to override it, you specify "none" as per the docs.

OverrideAction:
  None: {}
like image 175
Waseem Mir Avatar answered Oct 27 '25 16:10

Waseem Mir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!