aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 56 forks source link

AWS::WAFv2::RuleGroup RateBasedStatement missing CONSTANT Aggregate Key support #1795

Closed nuttmeister closed 9 months ago

nuttmeister commented 1 year ago

Name of the resource

AWS::WAFv2::RuleGroup

Resource Name

No response

Issue Description

You cannot create a rate based statement with aggregate key 'CONSTANT', even though it's supported according to the docs. It's fully supported in the API. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-ratebasedstatement.html

Found that support was supposedly added in early august: https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/1736

Setting it up either as per the CF docs or mimic a successful API call will cause the error #/Rules/0/Statement/RateBasedStatement/AggregateKeyType: failed validation constraint for keyword [enum] when deploying.

When, for example, using a rate based statement as below.

{
  "RateBasedStatement": {
    "Limit": 100,
    "AggregateKeyType": "CONSTANT",
    "ScopeDownStatement": {
      "LabelMatchStatement": {
        "Scope": "LABEL",
        "Key": "my:label"
      }
    }
  }
}

Expected Behavior

To be able to create a rate based rule with aggregate key 'CONSTANT'.

Observed Behavior

Validation error, wrong enum.

Test Cases

Add test case for adding a CONSTANT rate based statement.

Other Details

No response

nuttmeister commented 1 year ago

Can verify that this is now working in CloudFormation. Thanks.