SDK for PHP V3

Client: Aws\WAFV2\WAFV2Client
Service ID: wafv2
Version: 2019-07-29

This page describes the parameters and results for the operations of the AWS WAFV2 (2019-07-29), and shows how to use the Aws\WAFV2\WAFV2Client object to call the described operations. This documentation is specific to the 2019-07-29 API version of the service.

Operation Summary

Each of the following operations can be created from a client using $client->getCommand('CommandName'), where "CommandName" is the name of one of the following operations. Note: a command is a value that encapsulates an operation and the parameters used to create an HTTP request.

You can also create and send a command immediately using the magic methods available on a client object: $client->commandName(/* parameters */). You can send the command asynchronously (returning a promise) by appending the word "Async" to the operation name: $client->commandNameAsync(/* parameters */).

AssociateWebACL ( array $params = [] )
Associates a web ACL with a resource, to protect the resource.
CheckCapacity ( array $params = [] )
Returns the web ACL capacity unit (WCU) requirements for a specified scope and set of rules.
CreateAPIKey ( array $params = [] )
Creates an API key that contains a set of token domains.
CreateIPSet ( array $params = [] )
Creates an IPSet, which you use to identify web requests that originate from specific IP addresses or ranges of IP addresses.
CreateRegexPatternSet ( array $params = [] )
Creates a RegexPatternSet, which you reference in a RegexPatternSetReferenceStatement, to have WAF inspect a web request component for the specified patterns.
CreateRuleGroup ( array $params = [] )
Creates a RuleGroup per the specifications provided.
CreateWebACL ( array $params = [] )
Creates a WebACL per the specifications provided.
DeleteAPIKey ( array $params = [] )
Deletes the specified API key.
DeleteFirewallManagerRuleGroups ( array $params = [] )
Deletes all rule groups that are managed by Firewall Manager from the specified WebACL.
DeleteIPSet ( array $params = [] )
Deletes the specified IPSet.
DeleteLoggingConfiguration ( array $params = [] )
Deletes the LoggingConfiguration from the specified web ACL.
DeletePermissionPolicy ( array $params = [] )
Permanently deletes an IAM policy from the specified rule group.
DeleteRegexPatternSet ( array $params = [] )
Deletes the specified RegexPatternSet.
DeleteRuleGroup ( array $params = [] )
Deletes the specified RuleGroup.
DeleteWebACL ( array $params = [] )
Deletes the specified WebACL.
DescribeAllManagedProducts ( array $params = [] )
Provides high-level information for the Amazon Web Services Managed Rules rule groups and Amazon Web Services Marketplace managed rule groups.
DescribeManagedProductsByVendor ( array $params = [] )
Provides high-level information for the managed rule groups owned by a specific vendor.
DescribeManagedRuleGroup ( array $params = [] )
Provides high-level information for a managed rule group, including descriptions of the rules.
DisassociateWebACL ( array $params = [] )
Disassociates the specified resource from its web ACL association, if it has one.
GenerateMobileSdkReleaseUrl ( array $params = [] )
Generates a presigned download URL for the specified release of the mobile SDK.
GetDecryptedAPIKey ( array $params = [] )
Returns your API key in decrypted form.
GetIPSet ( array $params = [] )
Retrieves the specified IPSet.
GetLoggingConfiguration ( array $params = [] )
Returns the LoggingConfiguration for the specified web ACL.
GetManagedRuleSet ( array $params = [] )
Retrieves the specified managed rule set.
GetMobileSdkRelease ( array $params = [] )
Retrieves information for the specified mobile SDK release, including release notes and tags.
GetPermissionPolicy ( array $params = [] )
Returns the IAM policy that is attached to the specified rule group.
GetRateBasedStatementManagedKeys ( array $params = [] )
Retrieves the IP addresses that are currently blocked by a rate-based rule instance.
GetRegexPatternSet ( array $params = [] )
Retrieves the specified RegexPatternSet.
GetRevenueStatistics ( array $params = [] )
Retrieves ranked monetization statistics.
GetRevenueStatisticsSummary ( array $params = [] )
Retrieves a summary of monetization revenue for the specified time window.
GetRevenueStatisticsTimeSeries ( array $params = [] )
Retrieves time series data for monetization revenue.
GetRuleGroup ( array $params = [] )
Retrieves the specified RuleGroup.
GetSampledRequests ( array $params = [] )
Gets detailed information about a specified number of requests--a sample--that WAF randomly selects from among the first 5,000 requests that your Amazon Web Services resource received during a time range that you choose.
GetTopPathStatisticsByTraffic ( array $params = [] )
Retrieves aggregated statistics about the top URI paths accessed by bot traffic for a specified web ACL and time window.
GetWebACL ( array $params = [] )
Retrieves the specified WebACL.
GetWebACLForResource ( array $params = [] )
Retrieves the WebACL for the specified resource.
ListAPIKeys ( array $params = [] )
Retrieves a list of the API keys that you've defined for the specified scope.
ListAvailableManagedRuleGroupVersions ( array $params = [] )
Returns a list of the available versions for the specified managed rule group.
ListAvailableManagedRuleGroups ( array $params = [] )
Retrieves an array of managed rule groups that are available for you to use.
ListIPSets ( array $params = [] )
Retrieves an array of IPSetSummary objects for the IP sets that you manage.
ListLoggingConfigurations ( array $params = [] )
Retrieves an array of your LoggingConfiguration objects.
ListManagedRuleSets ( array $params = [] )
Retrieves the managed rule sets that you own.
ListMobileSdkReleases ( array $params = [] )
Retrieves a list of the available releases for the mobile SDK and the specified device platform.
ListRegexPatternSets ( array $params = [] )
Retrieves an array of RegexPatternSetSummary objects for the regex pattern sets that you manage.
ListResourcesForWebACL ( array $params = [] )
Retrieves an array of the Amazon Resource Names (ARNs) for the resources that are associated with the specified web ACL.
ListRuleGroups ( array $params = [] )
Retrieves an array of RuleGroupSummary objects for the rule groups that you manage.
ListSettlementRecords ( array $params = [] )
Retrieves individual settlement transaction records for monetization.
ListTagsForResource ( array $params = [] )
Retrieves the TagInfoForResource for the specified resource.
ListWebACLs ( array $params = [] )
Retrieves an array of WebACLSummary objects for the web ACLs that you manage.
PutLoggingConfiguration ( array $params = [] )
Enables the specified LoggingConfiguration, to start logging from a web ACL, according to the configuration provided.
PutManagedRuleSetVersions ( array $params = [] )
Defines the versions of your managed rule set that you are offering to the customers.
PutPermissionPolicy ( array $params = [] )
Use this to share a rule group with other accounts.
TagResource ( array $params = [] )
Associates tags with the specified Amazon Web Services resource.
UntagResource ( array $params = [] )
Disassociates tags from an Amazon Web Services resource.
UpdateIPSet ( array $params = [] )
Updates the specified IPSet.
UpdateManagedRuleSetVersionExpiryDate ( array $params = [] )
Updates the expiration information for your managed rule set.
UpdateRegexPatternSet ( array $params = [] )
Updates the specified RegexPatternSet.
UpdateRuleGroup ( array $params = [] )
Updates the specified RuleGroup.
UpdateWebACL ( array $params = [] )
Updates the specified WebACL.

Operations

AssociateWebACL

$result = $client->associateWebACL([/* ... */]);
$promise = $client->associateWebACLAsync([/* ... */]);

Associates a web ACL with a resource, to protect the resource.

Use this for all resource types except for Amazon CloudFront distributions. For Amazon CloudFront, call UpdateDistribution for the distribution and provide the Amazon Resource Name (ARN) of the web ACL in the web ACL ID. For information, see UpdateDistribution in the Amazon CloudFront Developer Guide.

Required permissions for customer-managed IAM policies

This call requires permissions that are specific to the protected resource type. For details, see Permissions for AssociateWebACL in the WAF Developer Guide.

Temporary inconsistencies during updates

When you create or change a web ACL or other WAF resources, the changes take a small amount of time to propagate to all areas where the resources are stored. The propagation time can be from a few seconds to a number of minutes.

The following are examples of the temporary inconsistencies that you might notice during change propagation:

  • After you create a web ACL, if you try to associate it with a resource, you might get an exception indicating that the web ACL is unavailable.

  • After you add a rule group to a web ACL, the new rule group rules might be in effect in one area where the web ACL is used and not in another.

  • After you change a rule action setting, you might see the old action in some places and the new action in others.

  • After you add an IP address to an IP set that is in use in a blocking rule, the new address might be blocked in one area while still allowed in another.

Parameter Syntax

$result = $client->associateWebACL([
    'ResourceArn' => '<string>', // REQUIRED
    'WebACLArn' => '<string>', // REQUIRED
]);

Parameter Details

Members
ResourceArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the resource to associate with the web ACL.

The ARN must be in one of the following formats:

  • For an Application Load Balancer: arn:partition:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id

  • For an Amazon API Gateway REST API: arn:partition:apigateway:region::/restapis/api-id/stages/stage-name

  • For an AppSync GraphQL API: arn:partition:appsync:region:account-id:apis/GraphQLApiId

  • For an Amazon Cognito user pool: arn:partition:cognito-idp:region:account-id:userpool/user-pool-id

  • For an App Runner service: arn:partition:apprunner:region:account-id:service/apprunner-service-name/apprunner-service-id

  • For an Amazon Web Services Verified Access instance: arn:partition:ec2:region:account-id:verified-access-instance/instance-id

  • For an Amplify application: arn:partition:amplify:region:account-id:apps/app-id

  • For an Amazon Bedrock AgentCore Gateway: arn:partition:bedrock-agentcore:region:account-id:gateway/gateway-id

WebACLArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the web ACL that you want to associate with the resource.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

WAFInternalErrorException:

Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request.

WAFInvalidParameterException:

The operation failed because WAF didn't recognize a parameter in the request. For example:

  • You specified a parameter name or value that isn't valid.

  • Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested.

  • You tried to update a WebACL with a DefaultAction that isn't among the types available at DefaultAction.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.

WAFNonexistentItemException:

WAF couldn’t perform the operation because your resource doesn't exist. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate.

WAFUnavailableEntityException:

WAF couldn’t retrieve a resource that you specified for this operation. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate. Verify the resource specifications in your request parameters and then retry the operation.

WAFInvalidOperationException:

The operation isn't valid.

WAFLimitsExceededException:

WAF couldn’t perform the operation because you exceeded your resource limit. For example, the maximum number of WebACL objects that you can create for an Amazon Web Services account. For more information, see WAF quotas in the WAF Developer Guide.

WAFFeatureNotIncludedInPricingPlanException:

The operation failed because the specified WAF feature isn't supported by the CloudFront pricing plan associated with the web ACL.

CheckCapacity

$result = $client->checkCapacity([/* ... */]);
$promise = $client->checkCapacityAsync([/* ... */]);

Returns the web ACL capacity unit (WCU) requirements for a specified scope and set of rules. You can use this to check the capacity requirements for the rules you want to use in a RuleGroup or WebACL.

WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. 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. For more information, see WAF web ACL capacity units (WCU) in the WAF Developer Guide.

Parameter Syntax

$result = $client->checkCapacity([
    'Rules' => [ // REQUIRED
        [
            'Action' => [
                'Allow' => [
                    'CustomRequestHandling' => [
                        'InsertHeaders' => [ // REQUIRED
                            [
                                'Name' => '<string>', // REQUIRED
                                'Value' => '<string>', // REQUIRED
                            ],
                            // ...
                        ],
                    ],
                ],
                'Block' => [
                    'CustomResponse' => [
                        'CustomResponseBodyKey' => '<string>',
                        'ResponseCode' => <integer>, // REQUIRED
                        'ResponseHeaders' => [
                            [
                                'Name' => '<string>', // REQUIRED
                                'Value' => '<string>', // REQUIRED
                            ],
                            // ...
                        ],
                    ],
                ],
                'Captcha' => [
                    'CustomRequestHandling' => [
                        'InsertHeaders' => [ // REQUIRED
                            [
                                'Name' => '<string>', // REQUIRED
                                'Value' => '<string>', // REQUIRED
                            ],
                            // ...
                        ],
                    ],
                ],
                'Challenge' => [
                    'CustomRequestHandling' => [
                        'InsertHeaders' => [ // REQUIRED
                            [
                                'Name' => '<string>', // REQUIRED
                                'Value' => '<string>', // REQUIRED
                            ],
                            // ...
                        ],
                    ],
                ],
                'Count' => [
                    'CustomRequestHandling' => [
                        'InsertHeaders' => [ // REQUIRED
                            [
                                'Name' => '<string>', // REQUIRED
                                'Value' => '<string>', // REQUIRED
                            ],
                            // ...
                        ],
                    ],
                ],
                'Monetize' => [
                    'PriceMultiplier' => '<string>',
                ],
            ],
            'CaptchaConfig' => [
                'ImmunityTimeProperty' => [
                    'ImmunityTime' => <integer>, // REQUIRED
                ],
            ],
            'ChallengeConfig' => [
                'ImmunityTimeProperty' => [
                    'ImmunityTime' => <integer>, // REQUIRED
                ],
            ],
            'Name' => '<string>', // REQUIRED
            'OverrideAction' => [
                'Count' => [
                    'CustomRequestHandling' => [
                        'InsertHeaders' => [ // REQUIRED
                            [
                                'Name' => '<string>', // REQUIRED
                                'Value' => '<string>', // REQUIRED
                            ],
                            // ...
                        ],
                    ],
                ],
                'None' => [
                ],
            ],
            'Priority' => <integer>, // REQUIRED
            'RuleLabels' => [
                [
                    'Name' => '<string>', // REQUIRED
                ],
                // ...
            ],
            'Statement' => [ // REQUIRED
                'AndStatement' => [
                    'Statements' => [ // REQUIRED
                        [...], // RECURSIVE
                        // ...
                    ],
                ],
                'AsnMatchStatement' => [
                    'AsnList' => [<integer>, ...], // REQUIRED
                    'ForwardedIPConfig' => [
                        'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        'HeaderName' => '<string>', // REQUIRED
                    ],
                ],
                'ByteMatchStatement' => [
                    'FieldToMatch' => [ // REQUIRED
                        'AllQueryArguments' => [
                        ],
                        'Body' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Cookies' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedCookies' => ['<string>', ...],
                                'IncludedCookies' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'HeaderOrder' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'Headers' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedHeaders' => ['<string>', ...],
                                'IncludedHeaders' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA3Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA4Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JsonBody' => [
                            'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING',
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'IncludedPaths' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Method' => [
                        ],
                        'QueryString' => [
                        ],
                        'SingleHeader' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'SingleQueryArgument' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'UriFragment' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH',
                        ],
                        'UriPath' => [
                        ],
                    ],
                    'PositionalConstraint' => 'EXACTLY|STARTS_WITH|ENDS_WITH|CONTAINS|CONTAINS_WORD', // REQUIRED
                    'PreParseTextTransformations' => [
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|URL_DECODE|URL_DECODE_UNI|COMBINE_DUPLICATE_QUERY_ARGS_BY_COMMA|REPLACE_SEMICOLONS_WITH_AMPERSANDS', // REQUIRED
                        ],
                        // ...
                    ],
                    'SearchString' => <string || resource || Psr\Http\Message\StreamInterface>, // REQUIRED
                    'TextTransformations' => [ // REQUIRED
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                        ],
                        // ...
                    ],
                ],
                'GeoMatchStatement' => [
                    'CountryCodes' => ['<string>', ...],
                    'ForwardedIPConfig' => [
                        'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        'HeaderName' => '<string>', // REQUIRED
                    ],
                ],
                'IPSetReferenceStatement' => [
                    'ARN' => '<string>', // REQUIRED
                    'IPSetForwardedIPConfig' => [
                        'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        'HeaderName' => '<string>', // REQUIRED
                        'Position' => 'FIRST|LAST|ANY', // REQUIRED
                    ],
                ],
                'LabelMatchStatement' => [
                    'Key' => '<string>', // REQUIRED
                    'Scope' => 'LABEL|NAMESPACE', // REQUIRED
                ],
                'ManagedRuleGroupStatement' => [
                    'ExcludedRules' => [
                        [
                            'Name' => '<string>', // REQUIRED
                        ],
                        // ...
                    ],
                    'ManagedRuleGroupConfigs' => [
                        [
                            'AWSManagedRulesACFPRuleSet' => [
                                'CreationPath' => '<string>', // REQUIRED
                                'EnableRegexInPath' => true || false,
                                'RegistrationPagePath' => '<string>', // REQUIRED
                                'RequestInspection' => [ // REQUIRED
                                    'AddressFields' => [
                                        [
                                            'Identifier' => '<string>', // REQUIRED
                                        ],
                                        // ...
                                    ],
                                    'EmailField' => [
                                        'Identifier' => '<string>', // REQUIRED
                                    ],
                                    'PasswordField' => [
                                        'Identifier' => '<string>', // REQUIRED
                                    ],
                                    'PayloadType' => 'JSON|FORM_ENCODED', // REQUIRED
                                    'PhoneNumberFields' => [
                                        [
                                            'Identifier' => '<string>', // REQUIRED
                                        ],
                                        // ...
                                    ],
                                    'UsernameField' => [
                                        'Identifier' => '<string>', // REQUIRED
                                    ],
                                ],
                                'ResponseInspection' => [
                                    'BodyContains' => [
                                        'FailureStrings' => ['<string>', ...], // REQUIRED
                                        'SuccessStrings' => ['<string>', ...], // REQUIRED
                                    ],
                                    'Header' => [
                                        'FailureValues' => ['<string>', ...], // REQUIRED
                                        'Name' => '<string>', // REQUIRED
                                        'SuccessValues' => ['<string>', ...], // REQUIRED
                                    ],
                                    'Json' => [
                                        'FailureValues' => ['<string>', ...], // REQUIRED
                                        'Identifier' => '<string>', // REQUIRED
                                        'SuccessValues' => ['<string>', ...], // REQUIRED
                                    ],
                                    'StatusCode' => [
                                        'FailureCodes' => [<integer>, ...], // REQUIRED
                                        'SuccessCodes' => [<integer>, ...], // REQUIRED
                                    ],
                                ],
                            ],
                            'AWSManagedRulesATPRuleSet' => [
                                'EnableRegexInPath' => true || false,
                                'LoginPath' => '<string>', // REQUIRED
                                'RequestInspection' => [
                                    'PasswordField' => [ // REQUIRED
                                        'Identifier' => '<string>', // REQUIRED
                                    ],
                                    'PayloadType' => 'JSON|FORM_ENCODED', // REQUIRED
                                    'UsernameField' => [ // REQUIRED
                                        'Identifier' => '<string>', // REQUIRED
                                    ],
                                ],
                                'ResponseInspection' => [
                                    'BodyContains' => [
                                        'FailureStrings' => ['<string>', ...], // REQUIRED
                                        'SuccessStrings' => ['<string>', ...], // REQUIRED
                                    ],
                                    'Header' => [
                                        'FailureValues' => ['<string>', ...], // REQUIRED
                                        'Name' => '<string>', // REQUIRED
                                        'SuccessValues' => ['<string>', ...], // REQUIRED
                                    ],
                                    'Json' => [
                                        'FailureValues' => ['<string>', ...], // REQUIRED
                                        'Identifier' => '<string>', // REQUIRED
                                        'SuccessValues' => ['<string>', ...], // REQUIRED
                                    ],
                                    'StatusCode' => [
                                        'FailureCodes' => [<integer>, ...], // REQUIRED
                                        'SuccessCodes' => [<integer>, ...], // REQUIRED
                                    ],
                                ],
                            ],
                            'AWSManagedRulesAntiDDoSRuleSet' => [
                                'ClientSideActionConfig' => [ // REQUIRED
                                    'Challenge' => [ // REQUIRED
                                        'ExemptUriRegularExpressions' => [
                                            [
                                                'RegexString' => '<string>',
                                            ],
                                            // ...
                                        ],
                                        'Sensitivity' => 'LOW|MEDIUM|HIGH',
                                        'UsageOfAction' => 'ENABLED|DISABLED', // REQUIRED
                                    ],
                                ],
                                'SensitivityToBlock' => 'LOW|MEDIUM|HIGH',
                            ],
                            'AWSManagedRulesBotControlRuleSet' => [
                                'EnableMachineLearning' => true || false,
                                'InspectionLevel' => 'COMMON|TARGETED', // REQUIRED
                            ],
                            'LoginPath' => '<string>',
                            'PasswordField' => [
                                'Identifier' => '<string>', // REQUIRED
                            ],
                            'PayloadType' => 'JSON|FORM_ENCODED',
                            'UsernameField' => [
                                'Identifier' => '<string>', // REQUIRED
                            ],
                        ],
                        // ...
                    ],
                    'Name' => '<string>', // REQUIRED
                    'RuleActionOverrides' => [
                        [
                            'ActionToUse' => [ // REQUIRED
                                'Allow' => [
                                    'CustomRequestHandling' => [
                                        'InsertHeaders' => [ // REQUIRED
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Block' => [
                                    'CustomResponse' => [
                                        'CustomResponseBodyKey' => '<string>',
                                        'ResponseCode' => <integer>, // REQUIRED
                                        'ResponseHeaders' => [
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Captcha' => [
                                    'CustomRequestHandling' => [
                                        'InsertHeaders' => [ // REQUIRED
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Challenge' => [
                                    'CustomRequestHandling' => [
                                        'InsertHeaders' => [ // REQUIRED
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Count' => [
                                    'CustomRequestHandling' => [
                                        'InsertHeaders' => [ // REQUIRED
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Monetize' => [
                                    'PriceMultiplier' => '<string>',
                                ],
                            ],
                            'Name' => '<string>', // REQUIRED
                        ],
                        // ...
                    ],
                    'ScopeDownStatement' => [...], // RECURSIVE
                    'VendorName' => '<string>', // REQUIRED
                    'Version' => '<string>',
                ],
                'NotStatement' => [
                    'Statement' => [...], // REQUIRED, RECURSIVE
                ],
                'OrStatement' => [
                    'Statements' => [ // REQUIRED
                        [...], // RECURSIVE
                        // ...
                    ],
                ],
                'RateBasedStatement' => [
                    'AggregateKeyType' => 'IP|FORWARDED_IP|CUSTOM_KEYS|CONSTANT', // REQUIRED
                    'CustomKeys' => [
                        [
                            'ASN' => [
                            ],
                            'Cookie' => [
                                'Name' => '<string>', // REQUIRED
                                'TextTransformations' => [ // REQUIRED
                                    [
                                        'Priority' => <integer>, // REQUIRED
                                        'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                                    ],
                                    // ...
                                ],
                            ],
                            'ForwardedIP' => [
                            ],
                            'HTTPMethod' => [
                            ],
                            'Header' => [
                                'Name' => '<string>', // REQUIRED
                                'TextTransformations' => [ // REQUIRED
                                    [
                                        'Priority' => <integer>, // REQUIRED
                                        'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                                    ],
                                    // ...
                                ],
                            ],
                            'IP' => [
                            ],
                            'JA3Fingerprint' => [
                                'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                            ],
                            'JA4Fingerprint' => [
                                'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                            ],
                            'LabelNamespace' => [
                                'Namespace' => '<string>', // REQUIRED
                            ],
                            'QueryArgument' => [
                                'Name' => '<string>', // REQUIRED
                                'TextTransformations' => [ // REQUIRED
                                    [
                                        'Priority' => <integer>, // REQUIRED
                                        'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                                    ],
                                    // ...
                                ],
                            ],
                            'QueryString' => [
                                'TextTransformations' => [ // REQUIRED
                                    [
                                        'Priority' => <integer>, // REQUIRED
                                        'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                                    ],
                                    // ...
                                ],
                            ],
                            'UriPath' => [
                                'TextTransformations' => [ // REQUIRED
                                    [
                                        'Priority' => <integer>, // REQUIRED
                                        'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                                    ],
                                    // ...
                                ],
                            ],
                        ],
                        // ...
                    ],
                    'EvaluationWindowSec' => <integer>,
                    'ForwardedIPConfig' => [
                        'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        'HeaderName' => '<string>', // REQUIRED
                    ],
                    'Limit' => <integer>, // REQUIRED
                    'ScopeDownStatement' => [...], // RECURSIVE
                ],
                'RegexMatchStatement' => [
                    'FieldToMatch' => [ // REQUIRED
                        'AllQueryArguments' => [
                        ],
                        'Body' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Cookies' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedCookies' => ['<string>', ...],
                                'IncludedCookies' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'HeaderOrder' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'Headers' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedHeaders' => ['<string>', ...],
                                'IncludedHeaders' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA3Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA4Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JsonBody' => [
                            'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING',
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'IncludedPaths' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Method' => [
                        ],
                        'QueryString' => [
                        ],
                        'SingleHeader' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'SingleQueryArgument' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'UriFragment' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH',
                        ],
                        'UriPath' => [
                        ],
                    ],
                    'PreParseTextTransformations' => [
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|URL_DECODE|URL_DECODE_UNI|COMBINE_DUPLICATE_QUERY_ARGS_BY_COMMA|REPLACE_SEMICOLONS_WITH_AMPERSANDS', // REQUIRED
                        ],
                        // ...
                    ],
                    'RegexString' => '<string>', // REQUIRED
                    'TextTransformations' => [ // REQUIRED
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                        ],
                        // ...
                    ],
                ],
                'RegexPatternSetReferenceStatement' => [
                    'ARN' => '<string>', // REQUIRED
                    'FieldToMatch' => [ // REQUIRED
                        'AllQueryArguments' => [
                        ],
                        'Body' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Cookies' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedCookies' => ['<string>', ...],
                                'IncludedCookies' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'HeaderOrder' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'Headers' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedHeaders' => ['<string>', ...],
                                'IncludedHeaders' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA3Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA4Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JsonBody' => [
                            'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING',
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'IncludedPaths' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Method' => [
                        ],
                        'QueryString' => [
                        ],
                        'SingleHeader' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'SingleQueryArgument' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'UriFragment' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH',
                        ],
                        'UriPath' => [
                        ],
                    ],
                    'PreParseTextTransformations' => [
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|URL_DECODE|URL_DECODE_UNI|COMBINE_DUPLICATE_QUERY_ARGS_BY_COMMA|REPLACE_SEMICOLONS_WITH_AMPERSANDS', // REQUIRED
                        ],
                        // ...
                    ],
                    'TextTransformations' => [ // REQUIRED
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                        ],
                        // ...
                    ],
                ],
                'RuleGroupReferenceStatement' => [
                    'ARN' => '<string>', // REQUIRED
                    'ExcludedRules' => [
                        [
                            'Name' => '<string>', // REQUIRED
                        ],
                        // ...
                    ],
                    'RuleActionOverrides' => [
                        [
                            'ActionToUse' => [ // REQUIRED
                                'Allow' => [
                                    'CustomRequestHandling' => [
                                        'InsertHeaders' => [ // REQUIRED
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Block' => [
                                    'CustomResponse' => [
                                        'CustomResponseBodyKey' => '<string>',
                                        'ResponseCode' => <integer>, // REQUIRED
                                        'ResponseHeaders' => [
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Captcha' => [
                                    'CustomRequestHandling' => [
                                        'InsertHeaders' => [ // REQUIRED
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Challenge' => [
                                    'CustomRequestHandling' => [
                                        'InsertHeaders' => [ // REQUIRED
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Count' => [
                                    'CustomRequestHandling' => [
                                        'InsertHeaders' => [ // REQUIRED
                                            [
                                                'Name' => '<string>', // REQUIRED
                                                'Value' => '<string>', // REQUIRED
                                            ],
                                            // ...
                                        ],
                                    ],
                                ],
                                'Monetize' => [
                                    'PriceMultiplier' => '<string>',
                                ],
                            ],
                            'Name' => '<string>', // REQUIRED
                        ],
                        // ...
                    ],
                ],
                'SizeConstraintStatement' => [
                    'ComparisonOperator' => 'EQ|NE|LE|LT|GE|GT', // REQUIRED
                    'FieldToMatch' => [ // REQUIRED
                        'AllQueryArguments' => [
                        ],
                        'Body' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Cookies' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedCookies' => ['<string>', ...],
                                'IncludedCookies' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'HeaderOrder' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'Headers' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedHeaders' => ['<string>', ...],
                                'IncludedHeaders' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA3Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA4Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JsonBody' => [
                            'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING',
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'IncludedPaths' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Method' => [
                        ],
                        'QueryString' => [
                        ],
                        'SingleHeader' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'SingleQueryArgument' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'UriFragment' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH',
                        ],
                        'UriPath' => [
                        ],
                    ],
                    'PreParseTextTransformations' => [
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|URL_DECODE|URL_DECODE_UNI|COMBINE_DUPLICATE_QUERY_ARGS_BY_COMMA|REPLACE_SEMICOLONS_WITH_AMPERSANDS', // REQUIRED
                        ],
                        // ...
                    ],
                    'Size' => <integer>, // REQUIRED
                    'TextTransformations' => [ // REQUIRED
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                        ],
                        // ...
                    ],
                ],
                'SqliMatchStatement' => [
                    'FieldToMatch' => [ // REQUIRED
                        'AllQueryArguments' => [
                        ],
                        'Body' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Cookies' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedCookies' => ['<string>', ...],
                                'IncludedCookies' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'HeaderOrder' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'Headers' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedHeaders' => ['<string>', ...],
                                'IncludedHeaders' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA3Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA4Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JsonBody' => [
                            'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING',
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'IncludedPaths' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Method' => [
                        ],
                        'QueryString' => [
                        ],
                        'SingleHeader' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'SingleQueryArgument' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'UriFragment' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH',
                        ],
                        'UriPath' => [
                        ],
                    ],
                    'PreParseTextTransformations' => [
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|URL_DECODE|URL_DECODE_UNI|COMBINE_DUPLICATE_QUERY_ARGS_BY_COMMA|REPLACE_SEMICOLONS_WITH_AMPERSANDS', // REQUIRED
                        ],
                        // ...
                    ],
                    'SensitivityLevel' => 'LOW|HIGH',
                    'TextTransformations' => [ // REQUIRED
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                        ],
                        // ...
                    ],
                ],
                'XssMatchStatement' => [
                    'FieldToMatch' => [ // REQUIRED
                        'AllQueryArguments' => [
                        ],
                        'Body' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Cookies' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedCookies' => ['<string>', ...],
                                'IncludedCookies' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'HeaderOrder' => [
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'Headers' => [
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'ExcludedHeaders' => ['<string>', ...],
                                'IncludedHeaders' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA3Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JA4Fingerprint' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED
                        ],
                        'JsonBody' => [
                            'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING',
                            'MatchPattern' => [ // REQUIRED
                                'All' => [
                                ],
                                'IncludedPaths' => ['<string>', ...],
                            ],
                            'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED
                            'OversizeHandling' => 'CONTINUE|MATCH|NO_MATCH',
                        ],
                        'Method' => [
                        ],
                        'QueryString' => [
                        ],
                        'SingleHeader' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'SingleQueryArgument' => [
                            'Name' => '<string>', // REQUIRED
                        ],
                        'UriFragment' => [
                            'FallbackBehavior' => 'MATCH|NO_MATCH',
                        ],
                        'UriPath' => [
                        ],
                    ],
                    'PreParseTextTransformations' => [
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|URL_DECODE|URL_DECODE_UNI|COMBINE_DUPLICATE_QUERY_ARGS_BY_COMMA|REPLACE_SEMICOLONS_WITH_AMPERSANDS', // REQUIRED
                        ],
                        // ...
                    ],
                    'TextTransformations' => [ // REQUIRED
                        [
                            'Priority' => <integer>, // REQUIRED
                            'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE|BASE64_DECODE|HEX_DECODE|MD5|REPLACE_COMMENTS|ESCAPE_SEQ_DECODE|SQL_HEX_DECODE|CSS_DECODE|JS_DECODE|NORMALIZE_PATH|NORMALIZE_PATH_WIN|REMOVE_NULLS|REPLACE_NULLS|BASE64_DECODE_EXT|URL_DECODE_UNI|UTF8_TO_UNICODE|REMOVE_WHITESPACE|TRIM|TRIM_LEFT|TRIM_RIGHT|REMOVE_COMMENTS_CHAR|UPPERCASE|CMD_LINE_WIN|CMD_LINE_UNIX|JS_DECODE_EXT|SHA256', // REQUIRED
                        ],
                        // ...
                    ],
                ],
            ],
            'VisibilityConfig' => [ // REQUIRED
                'CloudWatchMetricsEnabled' => true || false, // REQUIRED
                'MetricName' => '<string>', // REQUIRED
                'SampledRequestsEnabled' => true || false, // REQUIRED
            ],
        ],
        // ...
    ],
    'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED
]);

Parameter Details

Members
Rules
Required: Yes
Type: Array of Rule structures

An array of Rule that you're configuring to use in a rule group or web ACL.

Scope
Required: Yes
Type: string

Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use CLOUDFRONT.

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.

Result Syntax

[
    'Capacity' => <integer>,
]

Result Details

Members
Capacity
Type: long (int|float)

The capacity required by the rules and scope.

Errors

WAFInternalErrorException:

Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request.

WAFInvalidParameterException:

The operation failed because WAF didn't recognize a parameter in the request. For example:

  • You specified a parameter name or value that isn't valid.

  • Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested.

  • You tried to update a WebACL with a DefaultAction that isn't among the types available at DefaultAction.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.

WAFNonexistentItemException:

WAF couldn’t perform the operation because your resource doesn't exist. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate.

WAFLimitsExceededException:

WAF couldn’t perform the operation because you exceeded your resource limit. For example, the maximum number of WebACL objects that you can create for an Amazon Web Services account. For more information, see WAF quotas in the WAF Developer Guide.

WAFInvalidResourceException:

WAF couldn’t perform the operation because the resource that you requested isn’t valid. Check the resource, and try again.

WAFUnavailableEntityException:

WAF couldn’t retrieve a resource that you specified for this operation. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate. Verify the resource specifications in your request parameters and then retry the operation.

WAFSubscriptionNotFoundException:

You tried to use a managed rule group that's available by subscription, but you aren't subscribed to it yet.

WAFExpiredManagedRuleGroupVersionException:

The operation failed because the specified version for the managed rule group has expired. You can retrieve the available versions for the managed rule group by calling ListAvailableManagedRuleGroupVersions.

WAFInvalidOperationException:

The operation isn't valid.

CreateAPIKey

$result = $client->createAPIKey([/* ... */]);
$promise = $client->createAPIKeyAsync([/* ... */]);

Creates an API key that contains a set of token domains.

API keys are required for the integration of the CAPTCHA API in your JavaScript client applications. The API lets you customize the placement and characteristics of the CAPTCHA puzzle for your end users. For more information about the CAPTCHA JavaScript integration, see WAF client application integration in the WAF Developer Guide.

You can use a single key for up to 5 domains. After you generate a key, you can copy it for use in your JavaScript integration.

Parameter Syntax

$result = $client->createAPIKey([
    'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED
    'TokenDomains' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
Scope
Required: Yes
Type: string

Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use CLOUDFRONT.

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.

TokenDomains
Required: Yes
Type: Array of strings

The client application domains that you want to use this API key for.

Example JSON: "TokenDomains": ["abc.com", "store.abc.com"]

Public suffixes aren't allowed. For example, you can't use gov.au or co.uk as token domains.

Result Syntax

[
    'APIKey' => '<string>',
]

Result Details

Members
APIKey
Type: string

The generated, encrypted API key. You can copy this for use in your JavaScript CAPTCHA integration.

Errors

WAFInternalErrorException:

Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request.

WAFInvalidParameterException:

The operation failed because WAF didn't recognize a parameter in the request. For example:

  • You specified a parameter name or value that isn't valid.

  • Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested.

  • You tried to update a WebACL with a DefaultAction that isn't among the types available at DefaultAction.

  • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.

WAFInvalidOperationException:

The operation isn't valid.

WAFLimitsExceededException:

WAF couldn’t perform the operation because you exceeded your resource limit. For example, the maximum number of WebACL objects that you can create for an Amazon Web Services account. For more information, see WAF quotas in the WAF Developer Guide.

CreateIPSet

$result = $client->createIPSet([/* ... */]);
$promise = $client->createIPSetAsync([/* ... */]);

Creates an IPSet, which you use to identify web requests that originate from specific IP addresses or ranges of IP addresses. For example, if you're receiving a lot of requests from a ranges of IP addresses, you can configure WAF to block them using an IPSet that lists those IP addresses.

Parameter Syntax

$result = $client->createIPSet([
    'Addresses' => ['<string>', ...], // REQUIRED
    'Description' => '<string>',
    'IPAddressVersion' => 'IPV4|IPV6', // REQUIRED
    'Name' => '<string>', // REQUIRED
    'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED
    'Tags' => [
        [
            'Key' => '<string>', // REQUIRED
            'Value' => '<string>', // REQUIRED
        ],
        // ...
    ],
]);

Parameter Details

Members
Addresses
Required: Yes
Type: Array of strings

Contains an array of strings that specifies zero or more IP addresses or blocks of IP addresses that you want WAF to inspect for in incoming requests. All addresses must be specified using Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for /0.

Example address strings:

  • For requests that originated from the IP address 192.0.2.44, specify 192.0.2.44/32.

  • For requests that originated from IP addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24.

  • For requests that originated from the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify 1111:0000:0000:0000:0000:0000:0000:0111/128.

  • For requests that originated from IP addresses 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64.

For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.

Example JSON Addresses specifications:

  • Empty array: "Addresses": []

  • Array with one address: "Addresses": ["192.0.2.44/32"]

  • Array with three addresses: "Addresses": ["192.0.2.44/32", "192.0.2.0/24", "192.0.0.0/16"]