Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . wafv2 ]

create-rule-group

Description

Note

This is the latest version of AWS WAF , named AWS WAFV2, released in November, 2019. For information, including how to migrate your AWS WAF resources from the prior release, see the AWS WAF Developer Guide .

Creates a RuleGroup per the specifications provided.

A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL . When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  create-rule-group
--name <value>
--scope <value>
--capacity <value>
[--description <value>]
[--rules <value>]
--visibility-config <value>
[--tags <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--name (string)

The name of the rule group. You cannot change the name of a rule group after you create it.

--scope (string)

Specifies whether this is for an AWS CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB) or an API Gateway stage.

To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:

  • CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT --region=us-east-1 .
  • API and SDKs - For all calls, use the Region endpoint us-east-1.

Possible values:

  • CLOUDFRONT
  • REGIONAL

--capacity (long)

The web ACL capacity units (WCUs) required for this rule group.

When you create your own rule group, you define this, and you cannot change it after creation. When you add or modify the rules in a rule group, AWS WAF enforces this limit. You can check the capacity for a set of rules using CheckCapacity .

AWS WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500.

--description (string)

A description of the rule group that helps with identification. You cannot change the description of a rule group after you create it.

--rules (list)

The Rule statements used to identify the web requests that you want to allow, block, or count. Each rule includes one top-level statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.

JSON Syntax:

[
  {
    "Name": "string",
    "Priority": integer,
    "Statement": {
      "ByteMatchStatement": {
        "SearchString": blob,
        "FieldToMatch": {
          "SingleHeader": {
            "Name": "string"
          },
          "SingleQueryArgument": {
            "Name": "string"
          },
          "AllQueryArguments": {

          },
          "UriPath": {

          },
          "QueryString": {

          },
          "Body": {

          },
          "Method": {

          }
        },
        "TextTransformations": [
          {
            "Priority": integer,
            "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
          }
          ...
        ],
        "PositionalConstraint": "EXACTLY"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CONTAINS_WORD"
      },
      "SqliMatchStatement": {
        "FieldToMatch": {
          "SingleHeader": {
            "Name": "string"
          },
          "SingleQueryArgument": {
            "Name": "string"
          },
          "AllQueryArguments": {

          },
          "UriPath": {

          },
          "QueryString": {

          },
          "Body": {

          },
          "Method": {

          }
        },
        "TextTransformations": [
          {
            "Priority": integer,
            "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
          }
          ...
        ]
      },
      "XssMatchStatement": {
        "FieldToMatch": {
          "SingleHeader": {
            "Name": "string"
          },
          "SingleQueryArgument": {
            "Name": "string"
          },
          "AllQueryArguments": {

          },
          "UriPath": {

          },
          "QueryString": {

          },
          "Body": {

          },
          "Method": {

          }
        },
        "TextTransformations": [
          {
            "Priority": integer,
            "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
          }
          ...
        ]
      },
      "SizeConstraintStatement": {
        "FieldToMatch": {
          "SingleHeader": {
            "Name": "string"
          },
          "SingleQueryArgument": {
            "Name": "string"
          },
          "AllQueryArguments": {

          },
          "UriPath": {

          },
          "QueryString": {

          },
          "Body": {

          },
          "Method": {

          }
        },
        "ComparisonOperator": "EQ"|"NE"|"LE"|"LT"|"GE"|"GT",
        "Size": long,
        "TextTransformations": [
          {
            "Priority": integer,
            "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
          }
          ...
        ]
      },
      "GeoMatchStatement": {
        "CountryCodes": ["AF"|"AX"|"AL"|"DZ"|"AS"|"AD"|"AO"|"AI"|"AQ"|"AG"|"AR"|"AM"|"AW"|"AU"|"AT"|"AZ"|"BS"|"BH"|"BD"|"BB"|"BY"|"BE"|"BZ"|"BJ"|"BM"|"BT"|"BO"|"BQ"|"BA"|"BW"|"BV"|"BR"|"IO"|"BN"|"BG"|"BF"|"BI"|"KH"|"CM"|"CA"|"CV"|"KY"|"CF"|"TD"|"CL"|"CN"|"CX"|"CC"|"CO"|"KM"|"CG"|"CD"|"CK"|"CR"|"CI"|"HR"|"CU"|"CW"|"CY"|"CZ"|"DK"|"DJ"|"DM"|"DO"|"EC"|"EG"|"SV"|"GQ"|"ER"|"EE"|"ET"|"FK"|"FO"|"FJ"|"FI"|"FR"|"GF"|"PF"|"TF"|"GA"|"GM"|"GE"|"DE"|"GH"|"GI"|"GR"|"GL"|"GD"|"GP"|"GU"|"GT"|"GG"|"GN"|"GW"|"GY"|"HT"|"HM"|"VA"|"HN"|"HK"|"HU"|"IS"|"IN"|"ID"|"IR"|"IQ"|"IE"|"IM"|"IL"|"IT"|"JM"|"JP"|"JE"|"JO"|"KZ"|"KE"|"KI"|"KP"|"KR"|"KW"|"KG"|"LA"|"LV"|"LB"|"LS"|"LR"|"LY"|"LI"|"LT"|"LU"|"MO"|"MK"|"MG"|"MW"|"MY"|"MV"|"ML"|"MT"|"MH"|"MQ"|"MR"|"MU"|"YT"|"MX"|"FM"|"MD"|"MC"|"MN"|"ME"|"MS"|"MA"|"MZ"|"MM"|"NA"|"NR"|"NP"|"NL"|"NC"|"NZ"|"NI"|"NE"|"NG"|"NU"|"NF"|"MP"|"NO"|"OM"|"PK"|"PW"|"PS"|"PA"|"PG"|"PY"|"PE"|"PH"|"PN"|"PL"|"PT"|"PR"|"QA"|"RE"|"RO"|"RU"|"RW"|"BL"|"SH"|"KN"|"LC"|"MF"|"PM"|"VC"|"WS"|"SM"|"ST"|"SA"|"SN"|"RS"|"SC"|"SL"|"SG"|"SX"|"SK"|"SI"|"SB"|"SO"|"ZA"|"GS"|"SS"|"ES"|"LK"|"SD"|"SR"|"SJ"|"SZ"|"SE"|"CH"|"SY"|"TW"|"TJ"|"TZ"|"TH"|"TL"|"TG"|"TK"|"TO"|"TT"|"TN"|"TR"|"TM"|"TC"|"TV"|"UG"|"UA"|"AE"|"GB"|"US"|"UM"|"UY"|"UZ"|"VU"|"VE"|"VN"|"VG"|"VI"|"WF"|"EH"|"YE"|"ZM"|"ZW", ...]
      },
      "RuleGroupReferenceStatement": {
        "ARN": "string",
        "ExcludedRules": [
          {
            "Name": "string"
          }
          ...
        ]
      },
      "IPSetReferenceStatement": {
        "ARN": "string"
      },
      "RegexPatternSetReferenceStatement": {
        "ARN": "string",
        "FieldToMatch": {
          "SingleHeader": {
            "Name": "string"
          },
          "SingleQueryArgument": {
            "Name": "string"
          },
          "AllQueryArguments": {

          },
          "UriPath": {

          },
          "QueryString": {

          },
          "Body": {

          },
          "Method": {

          }
        },
        "TextTransformations": [
          {
            "Priority": integer,
            "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
          }
          ...
        ]
      },
      "RateBasedStatement": {
        "Limit": long,
        "AggregateKeyType": "IP",
        "ScopeDownStatement": {
          "ByteMatchStatement": {
            "SearchString": blob,
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
              }
              ...
            ],
            "PositionalConstraint": "EXACTLY"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CONTAINS_WORD"
          },
          "SqliMatchStatement": {
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
              }
              ...
            ]
          },
          "XssMatchStatement": {
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
              }
              ...
            ]
          },
          "SizeConstraintStatement": {
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "ComparisonOperator": "EQ"|"NE"|"LE"|"LT"|"GE"|"GT",
            "Size": long,
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERC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M"|"VC"|"WS"|"SM"|"ST"|"SA"|"SN"|"RS"|"SC"|"SL"|"SG"|"SX"|"SK"|"SI"|"SB"|"SO"|"ZA"|"GS"|"SS"|"ES"|"LK"|"SD"|"SR"|"SJ"|"SZ"|"SE"|"CH"|"SY"|"TW"|"TJ"|"TZ"|"TH"|"TL"|"TG"|"TK"|"TO"|"TT"|"TN"|"TR"|"TM"|"TC"|"TV"|"UG"|"UA"|"AE"|"GB"|"US"|"UM"|"UY"|"UZ"|"VU"|"VE"|"VN"|"VG"|"VI"|"WF"|"EH"|"YE"|"ZM"|"ZW", ...]
          },
          "RuleGroupReferenceStatement": {
            "ARN": "string",
            "ExcludedRules": [
              {
                "Name": "string"
              }
              ...
            ]
          },
          "IPSetReferenceStatement": {
            "ARN": "string"
          },
          "RegexPatternSetReferenceStatement": {
            "ARN": "string",
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
              }
              ...
            ]
          },
          "RateBasedStatement": {
            "Limit": long,
            "AggregateKeyType": "IP",
            "ScopeDownStatement": { ... recursive ... }
          },
          "AndStatement": {
            "Statements": [
              { ... recursive ... }
              ...
            ]
          },
          "OrStatement": {
            "Statements": [
              { ... recursive ... }
              ...
            ]
          },
          "NotStatement": {
            "Statement": { ... recursive ... }
          },
          "ManagedRuleGroupStatement": {
            "VendorName": "string",
            "Name": "string",
            "ExcludedRules": [
              {
                "Name": "string"
              }
              ...
            ]
          }
        }
      },
      "AndStatement": {
        "Statements": [
          {
            "ByteMatchStatement": {
              "SearchString": blob,
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
                }
                ...
              ],
              "PositionalConstraint": "EXACTLY"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CONTAINS_WORD"
            },
            "SqliMatchStatement": {
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
                }
                ...
              ]
            },
            "XssMatchStatement": {
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
                }
                ...
              ]
            },
            "SizeConstraintStatement": {
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "ComparisonOperator": "EQ"|"NE"|"LE"|"LT"|"GE"|"GT",
              "Size": long,
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_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"KN"|"LC"|"MF"|"PM"|"VC"|"WS"|"SM"|"ST"|"SA"|"SN"|"RS"|"SC"|"SL"|"SG"|"SX"|"SK"|"SI"|"SB"|"SO"|"ZA"|"GS"|"SS"|"ES"|"LK"|"SD"|"SR"|"SJ"|"SZ"|"SE"|"CH"|"SY"|"TW"|"TJ"|"TZ"|"TH"|"TL"|"TG"|"TK"|"TO"|"TT"|"TN"|"TR"|"TM"|"TC"|"TV"|"UG"|"UA"|"AE"|"GB"|"US"|"UM"|"UY"|"UZ"|"VU"|"VE"|"VN"|"VG"|"VI"|"WF"|"EH"|"YE"|"ZM"|"ZW", ...]
            },
            "RuleGroupReferenceStatement": {
              "ARN": "string",
              "ExcludedRules": [
                {
                  "Name": "string"
                }
                ...
              ]
            },
            "IPSetReferenceStatement": {
              "ARN": "string"
            },
            "RegexPatternSetReferenceStatement": {
              "ARN": "string",
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
                }
                ...
              ]
            },
            "RateBasedStatement": {
              "Limit": long,
              "AggregateKeyType": "IP",
              "ScopeDownStatement": { ... recursive ... }
            },
            "AndStatement": {
              "Statements": [
                { ... recursive ... }
                ...
              ]
            },
            "OrStatement": {
              "Statements": [
                { ... recursive ... }
                ...
              ]
            },
            "NotStatement": {
              "Statement": { ... recursive ... }
            },
            "ManagedRuleGroupStatement": {
              "VendorName": "string",
              "Name": "string",
              "ExcludedRules": [
                {
                  "Name": "string"
                }
                ...
              ]
            }
          }
          ...
        ]
      },
      "OrStatement": {
        "Statements": [
          {
            "ByteMatchStatement": {
              "SearchString": blob,
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
                }
                ...
              ],
              "PositionalConstraint": "EXACTLY"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CONTAINS_WORD"
            },
            "SqliMatchStatement": {
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
                }
                ...
              ]
            },
            "XssMatchStatement": {
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
                }
                ...
              ]
            },
            "SizeConstraintStatement": {
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "ComparisonOperator": "EQ"|"NE"|"LE"|"LT"|"GE"|"GT",
              "Size": long,
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type":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|"RE"|"RO"|"RU"|"RW"|"BL"|"SH"|"KN"|"LC"|"MF"|"PM"|"VC"|"WS"|"SM"|"ST"|"SA"|"SN"|"RS"|"SC"|"SL"|"SG"|"SX"|"SK"|"SI"|"SB"|"SO"|"ZA"|"GS"|"SS"|"ES"|"LK"|"SD"|"SR"|"SJ"|"SZ"|"SE"|"CH"|"SY"|"TW"|"TJ"|"TZ"|"TH"|"TL"|"TG"|"TK"|"TO"|"TT"|"TN"|"TR"|"TM"|"TC"|"TV"|"UG"|"UA"|"AE"|"GB"|"US"|"UM"|"UY"|"UZ"|"VU"|"VE"|"VN"|"VG"|"VI"|"WF"|"EH"|"YE"|"ZM"|"ZW", ...]
            },
            "RuleGroupReferenceStatement": {
              "ARN": "string",
              "ExcludedRules": [
                {
                  "Name": "string"
                }
                ...
              ]
            },
            "IPSetReferenceStatement": {
              "ARN": "string"
            },
            "RegexPatternSetReferenceStatement": {
              "ARN": "string",
              "FieldToMatch": {
                "SingleHeader": {
                  "Name": "string"
                },
                "SingleQueryArgument": {
                  "Name": "string"
                },
                "AllQueryArguments": {

                },
                "UriPath": {

                },
                "QueryString": {

                },
                "Body": {

                },
                "Method": {

                }
              },
              "TextTransformations": [
                {
                  "Priority": integer,
                  "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
                }
                ...
              ]
            },
            "RateBasedStatement": {
              "Limit": long,
              "AggregateKeyType": "IP",
              "ScopeDownStatement": { ... recursive ... }
            },
            "AndStatement": {
              "Statements": [
                { ... recursive ... }
                ...
              ]
            },
            "OrStatement": {
              "Statements": [
                { ... recursive ... }
                ...
              ]
            },
            "NotStatement": {
              "Statement": { ... recursive ... }
            },
            "ManagedRuleGroupStatement": {
              "VendorName": "string",
              "Name": "string",
              "ExcludedRules": [
                {
                  "Name": "string"
                }
                ...
              ]
            }
          }
          ...
        ]
      },
      "NotStatement": {
        "Statement": {
          "ByteMatchStatement": {
            "SearchString": blob,
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
              }
              ...
            ],
            "PositionalConstraint": "EXACTLY"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CONTAINS_WORD"
          },
          "SqliMatchStatement": {
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
              }
              ...
            ]
          },
          "XssMatchStatement": {
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
              }
              ...
            ]
          },
          "SizeConstraintStatement": {
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "ComparisonOperator": "EQ"|"NE"|"LE"|"LT"|"GE"|"GT",
            "Size": long,
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
              }
              ...
            ]
          },
          "GeoMatchStatement": {
            "CountryCodes": ["AF"|"AX"|"AL"|"DZ"|"AS"|"AD"|"AO"|"AI"|"AQ"|"AG"|"AR"|"AM"|"AW"|"AU"|"AT"|"AZ"|"BS"|"BH"|"BD"|"BB"|"BY"|"BE"|"BZ"|"BJ"|"BM"|"BT"|"BO"|"BQ"|"BA"|"BW"|"BV"|"BR"|"IO"|"BN"|"BG"|"BF"|"BI"|"KH"|"CM"|"CA"|"CV"|"KY"|"CF"|"TD"|"CL"|"CN"|"CX"|"CC"|"CO"|"KM"|"CG"|"CD"|"CK"|"CR"|"CI"|"HR"|"CU"|"CW"|"CY"|"CZ"|"DK"|"DJ"|"DM"|"DO"|"EC"|"EG"|"SV"|"GQ"|"ER"|"EE"|"ET"|"FK"|"FO"|"FJ"|"FI"|"FR"|"GF"|"PF"|"TF"|"GA"|"GM"|"GE"|"DE"|"GH"|"GI"|"GR"|"GL"|"GD"|"GP"|"GU"|"GT"|"GG"|"GN"|"GW"|"GY"|"HT"|"HM"|"VA"|"HN"|"HK"|"HU"|"IS"|"IN"|"ID"|"IR"|"IQ"|"IE"|"IM"|"IL"|"IT"|"JM"|"JP"|"JE"|"JO"|"KZ"|"KE"|"KI"|"KP"|"KR"|"KW"|"KG"|"LA"|"LV"|"LB"|"LS"|"LR"|"LY"|"LI"|"LT"|"LU"|"MO"|"MK"|"MG"|"MW"|"MY"|"MV"|"ML"|"MT"|"MH"|"MQ"|"MR"|"MU"|"YT"|"MX"|"FM"|"MD"|"MC"|"MN"|"ME"|"MS"|"MA"|"MZ"|"MM"|"NA"|"NR"|"NP"|"NL"|"NC"|"NZ"|"NI"|"NE"|"NG"|"NU"|"NF"|"MP"|"NO"|"OM"|"PK"|"PW"|"PS"|"PA"|"PG"|"PY"|"PE"|"PH"|"PN"|"PL"|"PT"|"PR"|"QA"|"RE"|"RO"|"RU"|"RW"|"BL"|"SH"|"KN"|"LC"|"MF"|"PM"|"VC"|"WS"|"SM"|"ST"|"SA"|"SN"|"RS"|"SC"|"SL"|"SG"|"SX"|"SK"|"SI"|"SB"|"SO"|"ZA"|"GS"|"SS"|"ES"|"LK"|"SD"|"SR"|"SJ"|"SZ"|"SE"|"CH"|"SY"|"TW"|"TJ"|"TZ"|"TH"|"TL"|"TG"|"TK"|"TO"|"TT"|"TN"|"TR"|"TM"|"TC"|"TV"|"UG"|"UA"|"AE"|"GB"|"US"|"UM"|"UY"|"UZ"|"VU"|"VE"|"VN"|"VG"|"VI"|"WF"|"EH"|"YE"|"ZM"|"ZW", ...]
          },
          "RuleGroupReferenceStatement": {
            "ARN": "string",
            "ExcludedRules": [
              {
                "Name": "string"
              }
              ...
            ]
          },
          "IPSetReferenceStatement": {
            "ARN": "string"
          },
          "RegexPatternSetReferenceStatement": {
            "ARN": "string",
            "FieldToMatch": {
              "SingleHeader": {
                "Name": "string"
              },
              "SingleQueryArgument": {
                "Name": "string"
              },
              "AllQueryArguments": {

              },
              "UriPath": {

              },
              "QueryString": {

              },
              "Body": {

              },
              "Method": {

              }
            },
            "TextTransformations": [
              {
                "Priority": integer,
                "Type": "NONE"|"COMPRESS_WHITE_SPACE"|"HTML_ENTITY_DECODE"|"LOWERCASE"|"CMD_LINE"|"URL_DECODE"
              }
              ...
            ]
          },
          "RateBasedStatement": {
            "Limit": long,
            "AggregateKeyType": "IP",
            "ScopeDownStatement": { ... recursive ... }
          },
          "AndStatement": {
            "Statements": [
              { ... recursive ... }
              ...
            ]
          },
          "OrStatement": {
            "Statements": [
              { ... recursive ... }
              ...
            ]
          },
          "NotStatement": {
            "Statement": { ... recursive ... }
          },
          "ManagedRuleGroupStatement": {
            "VendorName": "string",
            "Name": "string",
            "ExcludedRules": [
              {
                "Name": "string"
              }
              ...
            ]
          }
        }
      },
      "ManagedRuleGroupStatement": {
        "VendorName": "string",
        "Name": "string",
        "ExcludedRules": [
          {
            "Name": "string"
          }
          ...
        ]
      }
    },
    "Action": {
      "Block": {

      },
      "Allow": {

      },
      "Count": {

      }
    },
    "OverrideAction": {
      "Count": {

      },
      "None": {

      }
    },
    "VisibilityConfig": {
      "SampledRequestsEnabled": true|false,
      "CloudWatchMetricsEnabled": true|false,
      "MetricName": "string"
    }
  }
  ...
]

--visibility-config (structure)

Defines and enables Amazon CloudWatch metrics and web request sample collection.

Shorthand Syntax:

SampledRequestsEnabled=boolean,CloudWatchMetricsEnabled=boolean,MetricName=string

JSON Syntax:

{
  "SampledRequestsEnabled": true|false,
  "CloudWatchMetricsEnabled": true|false,
  "MetricName": "string"
}

--tags (list)

An array of key:value pairs to associate with the resource.

Shorthand Syntax:

Key=string,Value=string ...

JSON Syntax:

[
  {
    "Key": "string",
    "Value": "string"
  }
  ...
]

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

To create a custom rule group for use in your web ACLs

The following create-rule-group command creates a custom rule group for regional use. The rule statements for the group are provided in a JSON-formatted file.

aws wafv2 create-rule-group \
    --name "TestRuleGroup" \
    --scope REGIONAL \
    --capacity 250 \
    --rules file://waf-rule.json \
    --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName=TestRuleGroupMetrics \
    --region us-west-2

Contents of file://waf-rule.json:

[
    {
        "Name":"basic-rule",
        "Priority":0,
        "Statement":{
            "AndStatement":{
                "Statements":[
                    {
                        "ByteMatchStatement":{
                            "SearchString":"example.com",
                            "FieldToMatch":{
                                "SingleHeader":{
                                    "Name":"host"
                                }
                            },
                            "TextTransformations":[
                                {
                                    "Priority":0,
                                    "Type":"LOWERCASE"
                                }
                            ],
                            "PositionalConstraint":"EXACTLY"
                        }
                    },
                    {
                        "GeoMatchStatement":{
                            "CountryCodes":[
                                "US",
                                "IN"
                            ]
                        }
                    }
                ]
            }
        },
        "Action":{
            "Allow":{

            }
        },
        "VisibilityConfig":{
            "SampledRequestsEnabled":true,
            "CloudWatchMetricsEnabled":true,
            "MetricName":"basic-rule"
        }
    }
]

Output:

{
    "Summary":{
        "ARN":"arn:aws:wafv2:us-west-2:123456789012:regional/rulegroup/TestRuleGroup/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "Description":"",
        "Name":"TestRuleGroup",
        "LockToken":"7b3bcec2-374e-4c5a-b2b9-563bf47249f0",
        "Id":"a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
    }
}

For more information, see Managing Your Own Rule Groups in the AWS WAF, AWS Firewall Manager, and AWS Shield Advanced Developer Guide.

Output

Summary -> (structure)

High-level information about a RuleGroup , returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a RuleGroup , and the ARN, that you provide to the RuleGroupReferenceStatement to use the rule group in a Rule .

Name -> (string)

The name of the data type instance. You cannot change the name after you create the instance.

Id -> (string)

A unique identifier for the rule group. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.

Description -> (string)

A description of the rule group that helps with identification. You cannot change the description of a rule group after you create it.

LockToken -> (string)

A token used for optimistic locking. AWS WAF returns a token to your get and list requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like update and delete. AWS WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a WAFOptimisticLockException . If this happens, perform another get, and use the new token returned by that operation.

ARN -> (string)

The Amazon Resource Name (ARN) of the entity.