AWS WAFV2 2019-07-29
- 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 regional application resource, to protect the resource.
- CheckCapacity ( array $params = [] )
Returns the web ACL capacity unit (WCU) requirements for a specified scope and set of rules.
- 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 AWS 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.
- DeleteFirewallManagerRuleGroups ( array $params = [] )
Deletes all rule groups that are managed by AWS Firewall Manager for the specified web ACL.
- 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.
- DescribeManagedRuleGroup ( array $params = [] )
Provides high-level information for a managed rule group, including descriptions of the rules.
- DisassociateWebACL ( array $params = [] )
Disassociates a Web ACL from a regional application resource.
- GetIPSet ( array $params = [] )
Retrieves the specified IPSet.
- GetLoggingConfiguration ( array $params = [] )
Returns the LoggingConfiguration for the specified web ACL.
- GetPermissionPolicy ( array $params = [] )
Returns the IAM policy that is attached to the specified rule group.
- GetRateBasedStatementManagedKeys ( array $params = [] )
Retrieves the keys that are currently blocked by a rate-based rule.
- GetRegexPatternSet ( array $params = [] )
Retrieves the specified RegexPatternSet.
- GetRuleGroup ( array $params = [] )
Retrieves the specified RuleGroup.
- GetSampledRequests ( array $params = [] )
Gets detailed information about a specified number of requests--a sample--that AWS WAF randomly selects from among the first 5,000 requests that your AWS resource received during a time range that you choose.
- GetWebACL ( array $params = [] )
Retrieves the specified WebACL.
- GetWebACLForResource ( array $params = [] )
Retrieves the WebACL for the specified resource.
- 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.
- 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 regional 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.
- 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.
- PutPermissionPolicy ( array $params = [] )
Attaches an IAM policy to the specified resource.
- TagResource ( array $params = [] )
Associates tags with the specified AWS resource.
- UntagResource ( array $params = [] )
Disassociates tags from an AWS resource.
- UpdateIPSet ( array $params = [] )
Updates the specified IPSet.
- 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 regional application resource, to protect the resource. A regional application can be an Application Load Balancer (ALB), an API Gateway REST API, or an AppSync GraphQL API.
For AWS CloudFront, don't use this call. Instead, use your CloudFront distribution configuration. To associate a Web ACL, in the CloudFront call UpdateDistribution
, set the web ACL ID to the Amazon Resource Name (ARN) of the Web ACL. For information, see UpdateDistribution.
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:aws:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id
-
For an API Gateway REST API:
arn:aws:apigateway:region::/restapis/api-id/stages/stage-name
-
For an AppSync GraphQL API:
arn:aws:appsync:region:account-id:apis/GraphQLApiId
- 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
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
WAFUnavailableEntityException:
AWS WAF couldn’t retrieve the resource that you requested. Retry your request.
-
The operation isn't valid.
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.
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.
Parameter Syntax
$result = $client->checkCapacity([ 'Rules' => [ // REQUIRED [ 'Action' => [ 'Allow' => [ ], 'Block' => [ ], 'Count' => [ ], ], 'Name' => '<string>', // REQUIRED 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, // REQUIRED 'Statement' => [ // REQUIRED 'AndStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'ByteMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'PositionalConstraint' => 'EXACTLY|STARTS_WITH|ENDS_WITH|CONTAINS|CONTAINS_WORD', // 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', // 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 ], ], 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], 'Name' => '<string>', // REQUIRED 'VendorName' => '<string>', // REQUIRED ], 'NotStatement' => [ 'Statement' => [...], // REQUIRED, RECURSIVE ], 'OrStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'RateBasedStatement' => [ 'AggregateKeyType' => 'IP|FORWARDED_IP', // REQUIRED 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED 'HeaderName' => '<string>', // REQUIRED ], 'Limit' => <integer>, // REQUIRED 'ScopeDownStatement' => [...], // RECURSIVE ], 'RegexPatternSetReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], ], 'SizeConstraintStatement' => [ 'ComparisonOperator' => 'EQ|NE|LE|LT|GE|GT', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'Size' => <integer>, // REQUIRED 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'SqliMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'XssMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // 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 an AWS CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an API Gateway REST API, or an AppSync GraphQL API.
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
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
AWS WAF couldn’t perform the operation because the resource that you requested isn’t valid. Check the resource, and try again.
-
WAFUnavailableEntityException:
AWS WAF couldn’t retrieve the resource that you requested. Retry your request.
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 AWS 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 specify one or more IP addresses or blocks of IP addresses in Classless Inter-Domain Routing (CIDR) notation. AWS WAF supports all address ranges for IP versions IPv4 and IPv6.
Examples:
-
To configure AWS WAF to allow, block, or count requests that originated from the IP address 192.0.2.44, specify
192.0.2.44/32
. -
To configure AWS WAF to allow, block, or count requests that originated from IP addresses from 192.0.2.0 to 192.0.2.255, specify
192.0.2.0/24
. -
To configure AWS WAF to allow, block, or count 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
. -
To configure AWS WAF to allow, block, or count 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.
- Description
-
- Type: string
A description of the IP set that helps with identification.
- IPAddressVersion
-
- Required: Yes
- Type: string
Specify IPV4 or IPV6.
- Name
-
- Required: Yes
- Type: string
The name of the IP set. You cannot change the name of an
IPSet
after you create it. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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.
- Tags
-
- Type: Array of Tag structures
An array of key:value pairs to associate with the resource.
Result Syntax
[ 'Summary' => [ 'ARN' => '<string>', 'Description' => '<string>', 'Id' => '<string>', 'LockToken' => '<string>', 'Name' => '<string>', ], ]
Result Details
Members
- Summary
-
- Type: IPSetSummary structure
High-level information about an IPSet, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage an
IPSet
, and the ARN, that you provide to the IPSetReferenceStatement to use the address set in a Rule.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
CreateRegexPatternSet
$result = $client->createRegexPatternSet
([/* ... */]); $promise = $client->createRegexPatternSetAsync
([/* ... */]);
Creates a RegexPatternSet, which you reference in a RegexPatternSetReferenceStatement, to have AWS WAF inspect a web request component for the specified patterns.
Parameter Syntax
$result = $client->createRegexPatternSet([ 'Description' => '<string>', 'Name' => '<string>', // REQUIRED 'RegularExpressionList' => [ // REQUIRED [ 'RegexString' => '<string>', ], // ... ], 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED 'Tags' => [ [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', // REQUIRED ], // ... ], ]);
Parameter Details
Members
- Description
-
- Type: string
A description of the set that helps with identification.
- Name
-
- Required: Yes
- Type: string
The name of the set. You cannot change the name after you create the set.
- RegularExpressionList
-
- Required: Yes
- Type: Array of Regex structures
Array of regular expression strings.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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.
- Tags
-
- Type: Array of Tag structures
An array of key:value pairs to associate with the resource.
Result Syntax
[ 'Summary' => [ 'ARN' => '<string>', 'Description' => '<string>', 'Id' => '<string>', 'LockToken' => '<string>', 'Name' => '<string>', ], ]
Result Details
Members
- Summary
-
- Type: RegexPatternSetSummary structure
High-level information about a RegexPatternSet, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a
RegexPatternSet
, and the ARN, that you provide to the RegexPatternSetReferenceStatement to use the pattern set in a Rule.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
CreateRuleGroup
$result = $client->createRuleGroup
([/* ... */]); $promise = $client->createRuleGroupAsync
([/* ... */]);
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.
Parameter Syntax
$result = $client->createRuleGroup([ 'Capacity' => <integer>, // REQUIRED 'Description' => '<string>', 'Name' => '<string>', // REQUIRED 'Rules' => [ [ 'Action' => [ 'Allow' => [ ], 'Block' => [ ], 'Count' => [ ], ], 'Name' => '<string>', // REQUIRED 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, // REQUIRED 'Statement' => [ // REQUIRED 'AndStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'ByteMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'PositionalConstraint' => 'EXACTLY|STARTS_WITH|ENDS_WITH|CONTAINS|CONTAINS_WORD', // 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', // 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 ], ], 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], 'Name' => '<string>', // REQUIRED 'VendorName' => '<string>', // REQUIRED ], 'NotStatement' => [ 'Statement' => [...], // REQUIRED, RECURSIVE ], 'OrStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'RateBasedStatement' => [ 'AggregateKeyType' => 'IP|FORWARDED_IP', // REQUIRED 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED 'HeaderName' => '<string>', // REQUIRED ], 'Limit' => <integer>, // REQUIRED 'ScopeDownStatement' => [...], // RECURSIVE ], 'RegexPatternSetReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], ], 'SizeConstraintStatement' => [ 'ComparisonOperator' => 'EQ|NE|LE|LT|GE|GT', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'Size' => <integer>, // REQUIRED 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'SqliMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'XssMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], ], 'VisibilityConfig' => [ // REQUIRED 'CloudWatchMetricsEnabled' => true || false, // REQUIRED 'MetricName' => '<string>', // REQUIRED 'SampledRequestsEnabled' => true || false, // REQUIRED ], ], // ... ], 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED 'Tags' => [ [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', // REQUIRED ], // ... ], 'VisibilityConfig' => [ // REQUIRED 'CloudWatchMetricsEnabled' => true || false, // REQUIRED 'MetricName' => '<string>', // REQUIRED 'SampledRequestsEnabled' => true || false, // REQUIRED ], ]);
Parameter Details
Members
- Capacity
-
- Required: Yes
- Type: long (int|float)
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
-
- Type: string
A description of the rule group that helps with identification.
- Name
-
- Required: Yes
- Type: string
The name of the rule group. You cannot change the name of a rule group after you create it.
- Rules
-
- Type: Array of Rule structures
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.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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.
- Tags
-
- Type: Array of Tag structures
An array of key:value pairs to associate with the resource.
- VisibilityConfig
-
- Required: Yes
- Type: VisibilityConfig structure
Defines and enables Amazon CloudWatch metrics and web request sample collection.
Result Syntax
[ 'Summary' => [ 'ARN' => '<string>', 'Description' => '<string>', 'Id' => '<string>', 'LockToken' => '<string>', 'Name' => '<string>', ], ]
Result Details
Members
- Summary
-
- Type: RuleGroupSummary 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.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
WAFUnavailableEntityException:
AWS WAF couldn’t retrieve the resource that you requested. Retry your request.
-
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation isn't valid.
CreateWebACL
$result = $client->createWebACL
([/* ... */]); $promise = $client->createWebACLAsync
([/* ... */]);
Creates a WebACL per the specifications provided.
A Web ACL defines a collection of rules to use to inspect and control web requests. Each rule has an action defined (allow, block, or count) for requests that match the statement of the rule. In the Web ACL, you assign a default action to take (allow, block) for any request that does not match any of the rules. The rules in a Web ACL can be a combination of the types Rule, RuleGroup, and managed rule group. You can associate a Web ACL with one or more AWS resources to protect. The resources can be Amazon CloudFront, an Amazon API Gateway REST API, an Application Load Balancer, or an AWS AppSync GraphQL API.
Parameter Syntax
$result = $client->createWebACL([ 'DefaultAction' => [ // REQUIRED 'Allow' => [ ], 'Block' => [ ], ], 'Description' => '<string>', 'Name' => '<string>', // REQUIRED 'Rules' => [ [ 'Action' => [ 'Allow' => [ ], 'Block' => [ ], 'Count' => [ ], ], 'Name' => '<string>', // REQUIRED 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, // REQUIRED 'Statement' => [ // REQUIRED 'AndStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'ByteMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'PositionalConstraint' => 'EXACTLY|STARTS_WITH|ENDS_WITH|CONTAINS|CONTAINS_WORD', // 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', // 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 ], ], 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], 'Name' => '<string>', // REQUIRED 'VendorName' => '<string>', // REQUIRED ], 'NotStatement' => [ 'Statement' => [...], // REQUIRED, RECURSIVE ], 'OrStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'RateBasedStatement' => [ 'AggregateKeyType' => 'IP|FORWARDED_IP', // REQUIRED 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED 'HeaderName' => '<string>', // REQUIRED ], 'Limit' => <integer>, // REQUIRED 'ScopeDownStatement' => [...], // RECURSIVE ], 'RegexPatternSetReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], ], 'SizeConstraintStatement' => [ 'ComparisonOperator' => 'EQ|NE|LE|LT|GE|GT', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'Size' => <integer>, // REQUIRED 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'SqliMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'XssMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], ], 'VisibilityConfig' => [ // REQUIRED 'CloudWatchMetricsEnabled' => true || false, // REQUIRED 'MetricName' => '<string>', // REQUIRED 'SampledRequestsEnabled' => true || false, // REQUIRED ], ], // ... ], 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED 'Tags' => [ [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', // REQUIRED ], // ... ], 'VisibilityConfig' => [ // REQUIRED 'CloudWatchMetricsEnabled' => true || false, // REQUIRED 'MetricName' => '<string>', // REQUIRED 'SampledRequestsEnabled' => true || false, // REQUIRED ], ]);
Parameter Details
Members
- DefaultAction
-
- Required: Yes
- Type: DefaultAction structure
The action to perform if none of the
Rules
contained in theWebACL
match. - Description
-
- Type: string
A description of the Web ACL that helps with identification.
- Name
-
- Required: Yes
- Type: string
The name of the Web ACL. You cannot change the name of a Web ACL after you create it.
- Rules
-
- Type: Array of Rule structures
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.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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.
- Tags
-
- Type: Array of Tag structures
An array of key:value pairs to associate with the resource.
- VisibilityConfig
-
- Required: Yes
- Type: VisibilityConfig structure
Defines and enables Amazon CloudWatch metrics and web request sample collection.
Result Syntax
[ 'Summary' => [ 'ARN' => '<string>', 'Description' => '<string>', 'Id' => '<string>', 'LockToken' => '<string>', 'Name' => '<string>', ], ]
Result Details
Members
- Summary
-
- Type: WebACLSummary structure
High-level information about a WebACL, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a
WebACL
, and the ARN, that you provide to operations like AssociateWebACL.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
AWS WAF couldn’t perform the operation because the resource that you requested isn’t valid. Check the resource, and try again.
-
WAFUnavailableEntityException:
AWS WAF couldn’t retrieve the resource that you requested. Retry your request.
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
DeleteFirewallManagerRuleGroups
$result = $client->deleteFirewallManagerRuleGroups
([/* ... */]); $promise = $client->deleteFirewallManagerRuleGroupsAsync
([/* ... */]);
Deletes all rule groups that are managed by AWS Firewall Manager for the specified web ACL.
You can only use this if ManagedByFirewallManager
is false in the specified WebACL.
Parameter Syntax
$result = $client->deleteFirewallManagerRuleGroups([ 'WebACLArn' => '<string>', // REQUIRED 'WebACLLockToken' => '<string>', // REQUIRED ]);
Parameter Details
Members
- WebACLArn
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the web ACL.
- WebACLLockToken
-
- Required: Yes
- Type: 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.
Result Syntax
[ 'NextWebACLLockToken' => '<string>', ]
Result Details
Members
- NextWebACLLockToken
-
- Type: 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.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
The operation isn't valid.
DeleteIPSet
$result = $client->deleteIPSet
([/* ... */]); $promise = $client->deleteIPSetAsync
([/* ... */]);
Deletes the specified IPSet.
Parameter Syntax
$result = $client->deleteIPSet([ 'Id' => '<string>', // REQUIRED 'LockToken' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Id
-
- Required: Yes
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- LockToken
-
- Required: Yes
- Type: 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. - Name
-
- Required: Yes
- Type: string
The name of the IP set. You cannot change the name of an
IPSet
after you create it. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[]
Result Details
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS WAF couldn’t perform the operation because your resource is being used by another resource or it’s associated with another resource.
-
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
DeleteLoggingConfiguration
$result = $client->deleteLoggingConfiguration
([/* ... */]); $promise = $client->deleteLoggingConfigurationAsync
([/* ... */]);
Deletes the LoggingConfiguration from the specified web ACL.
Parameter Syntax
$result = $client->deleteLoggingConfiguration([ 'ResourceArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
- ResourceArn
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the web ACL from which you want to delete the LoggingConfiguration.
Result Syntax
[]
Result Details
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
DeletePermissionPolicy
$result = $client->deletePermissionPolicy
([/* ... */]); $promise = $client->deletePermissionPolicyAsync
([/* ... */]);
Permanently deletes an IAM policy from the specified rule group.
You must be the owner of the rule group to perform this operation.
Parameter Syntax
$result = $client->deletePermissionPolicy([ 'ResourceArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
DeleteRegexPatternSet
$result = $client->deleteRegexPatternSet
([/* ... */]); $promise = $client->deleteRegexPatternSetAsync
([/* ... */]);
Deletes the specified RegexPatternSet.
Parameter Syntax
$result = $client->deleteRegexPatternSet([ 'Id' => '<string>', // REQUIRED 'LockToken' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Id
-
- Required: Yes
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- LockToken
-
- Required: Yes
- Type: 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. - Name
-
- Required: Yes
- Type: string
The name of the set. You cannot change the name after you create the set.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[]
Result Details
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS WAF couldn’t perform the operation because your resource is being used by another resource or it’s associated with another resource.
-
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
DeleteRuleGroup
$result = $client->deleteRuleGroup
([/* ... */]); $promise = $client->deleteRuleGroupAsync
([/* ... */]);
Deletes the specified RuleGroup.
Parameter Syntax
$result = $client->deleteRuleGroup([ 'Id' => '<string>', // REQUIRED 'LockToken' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Id
-
- Required: Yes
- Type: 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.
- LockToken
-
- Required: Yes
- Type: 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. - Name
-
- Required: Yes
- Type: string
The name of the rule group. You cannot change the name of a rule group after you create it.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[]
Result Details
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS WAF couldn’t perform the operation because your resource is being used by another resource or it’s associated with another resource.
-
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
DeleteWebACL
$result = $client->deleteWebACL
([/* ... */]); $promise = $client->deleteWebACLAsync
([/* ... */]);
Deletes the specified WebACL.
You can only use this if ManagedByFirewallManager
is false in the specified WebACL.
Parameter Syntax
$result = $client->deleteWebACL([ 'Id' => '<string>', // REQUIRED 'LockToken' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Id
-
- Required: Yes
- Type: string
The unique identifier for the Web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- LockToken
-
- Required: Yes
- Type: 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. - Name
-
- Required: Yes
- Type: string
The name of the Web ACL. You cannot change the name of a Web ACL after you create it.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[]
Result Details
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS WAF couldn’t perform the operation because your resource is being used by another resource or it’s associated with another resource.
-
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
DescribeManagedRuleGroup
$result = $client->describeManagedRuleGroup
([/* ... */]); $promise = $client->describeManagedRuleGroupAsync
([/* ... */]);
Provides high-level information for a managed rule group, including descriptions of the rules.
Parameter Syntax
$result = $client->describeManagedRuleGroup([ 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED 'VendorName' => '<string>', // REQUIRED ]);
Parameter Details
Members
- Name
-
- Required: Yes
- Type: string
The name of the managed rule group. You use this, along with the vendor name, to identify the rule group.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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.
- VendorName
-
- Required: Yes
- Type: string
The name of the managed rule group vendor. You use this, along with the rule group name, to identify the rule group.
Result Syntax
[ 'Capacity' => <integer>, 'Rules' => [ [ 'Action' => [ 'Allow' => [ ], 'Block' => [ ], 'Count' => [ ], ], 'Name' => '<string>', ], // ... ], ]
Result Details
Members
- Capacity
-
- Type: long (int|float)
The web ACL capacity units (WCUs) required for this rule group. AWS WAF uses web ACL capacity units (WCU) 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 each rule's relative cost. Rule group capacity is fixed at creation, so users can plan their web ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500.
- Rules
-
- Type: Array of RuleSummary structures
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because the resource that you requested isn’t valid. Check the resource, and try again.
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation isn't valid.
DisassociateWebACL
$result = $client->disassociateWebACL
([/* ... */]); $promise = $client->disassociateWebACLAsync
([/* ... */]);
Disassociates a Web ACL from a regional application resource. A regional application can be an Application Load Balancer (ALB), an API Gateway REST API, or an AppSync GraphQL API.
For AWS CloudFront, don't use this call. Instead, use your CloudFront distribution configuration. To disassociate a Web ACL, provide an empty web ACL ID in the CloudFront call UpdateDistribution
. For information, see UpdateDistribution.
Parameter Syntax
$result = $client->disassociateWebACL([ 'ResourceArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
- ResourceArn
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the resource to disassociate from the web ACL.
The ARN must be in one of the following formats:
-
For an Application Load Balancer:
arn:aws:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id
-
For an API Gateway REST API:
arn:aws:apigateway:region::/restapis/api-id/stages/stage-name
-
For an AppSync GraphQL API:
arn:aws:appsync:region:account-id:apis/GraphQLApiId
Result Syntax
[]
Result Details
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation isn't valid.
GetIPSet
$result = $client->getIPSet
([/* ... */]); $promise = $client->getIPSetAsync
([/* ... */]);
Retrieves the specified IPSet.
Parameter Syntax
$result = $client->getIPSet([ 'Id' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Id
-
- Required: Yes
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- Name
-
- Required: Yes
- Type: string
The name of the IP set. You cannot change the name of an
IPSet
after you create it. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'IPSet' => [ 'ARN' => '<string>', 'Addresses' => ['<string>', ...], 'Description' => '<string>', 'IPAddressVersion' => 'IPV4|IPV6', 'Id' => '<string>', 'Name' => '<string>', ], 'LockToken' => '<string>', ]
Result Details
Members
- IPSet
-
- Type: IPSet structure
- LockToken
-
- Type: 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.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation isn't valid.
GetLoggingConfiguration
$result = $client->getLoggingConfiguration
([/* ... */]); $promise = $client->getLoggingConfigurationAsync
([/* ... */]);
Returns the LoggingConfiguration for the specified web ACL.
Parameter Syntax
$result = $client->getLoggingConfiguration([ 'ResourceArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
- ResourceArn
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the web ACL for which you want to get the LoggingConfiguration.
Result Syntax
[ 'LoggingConfiguration' => [ 'LogDestinationConfigs' => ['<string>', ...], 'ManagedByFirewallManager' => true || false, 'RedactedFields' => [ [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], // ... ], 'ResourceArn' => '<string>', ], ]
Result Details
Members
- LoggingConfiguration
-
- Type: LoggingConfiguration structure
The LoggingConfiguration for the specified web ACL.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
GetPermissionPolicy
$result = $client->getPermissionPolicy
([/* ... */]); $promise = $client->getPermissionPolicyAsync
([/* ... */]);
Returns the IAM policy that is attached to the specified rule group.
You must be the owner of the rule group to perform this operation.
Parameter Syntax
$result = $client->getPermissionPolicy([ 'ResourceArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Policy' => '<string>', ]
Result Details
Errors
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
GetRateBasedStatementManagedKeys
$result = $client->getRateBasedStatementManagedKeys
([/* ... */]); $promise = $client->getRateBasedStatementManagedKeysAsync
([/* ... */]);
Retrieves the keys that are currently blocked by a rate-based rule. The maximum number of managed keys that can be blocked for a single rate-based rule is 10,000. If more than 10,000 addresses exceed the rate limit, those with the highest rates are blocked.
Parameter Syntax
$result = $client->getRateBasedStatementManagedKeys([ 'RuleName' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED 'WebACLId' => '<string>', // REQUIRED 'WebACLName' => '<string>', // REQUIRED ]);
Parameter Details
Members
- RuleName
-
- Required: Yes
- Type: string
The name of the rate-based rule to get the keys for.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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.
- WebACLId
-
- Required: Yes
- Type: string
The unique identifier for the Web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- WebACLName
-
- Required: Yes
- Type: string
The name of the Web ACL. You cannot change the name of a Web ACL after you create it.
Result Syntax
[ 'ManagedKeysIPV4' => [ 'Addresses' => ['<string>', ...], 'IPAddressVersion' => 'IPV4|IPV6', ], 'ManagedKeysIPV6' => [ 'Addresses' => ['<string>', ...], 'IPAddressVersion' => 'IPV4|IPV6', ], ]
Result Details
Members
- ManagedKeysIPV4
-
- Type: RateBasedStatementManagedKeysIPSet structure
The keys that are of Internet Protocol version 4 (IPv4).
- ManagedKeysIPV6
-
- Type: RateBasedStatementManagedKeysIPSet structure
The keys that are of Internet Protocol version 6 (IPv6).
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation isn't valid.
GetRegexPatternSet
$result = $client->getRegexPatternSet
([/* ... */]); $promise = $client->getRegexPatternSetAsync
([/* ... */]);
Retrieves the specified RegexPatternSet.
Parameter Syntax
$result = $client->getRegexPatternSet([ 'Id' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Id
-
- Required: Yes
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- Name
-
- Required: Yes
- Type: string
The name of the set. You cannot change the name after you create the set.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'LockToken' => '<string>', 'RegexPatternSet' => [ 'ARN' => '<string>', 'Description' => '<string>', 'Id' => '<string>', 'Name' => '<string>', 'RegularExpressionList' => [ [ 'RegexString' => '<string>', ], // ... ], ], ]
Result Details
Members
- LockToken
-
- Type: 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. - RegexPatternSet
-
- Type: RegexPatternSet structure
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation isn't valid.
GetRuleGroup
$result = $client->getRuleGroup
([/* ... */]); $promise = $client->getRuleGroupAsync
([/* ... */]);
Retrieves the specified RuleGroup.
Parameter Syntax
$result = $client->getRuleGroup([ 'Id' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Id
-
- Required: Yes
- Type: 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.
- Name
-
- Required: Yes
- Type: string
The name of the rule group. You cannot change the name of a rule group after you create it.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'LockToken' => '<string>', 'RuleGroup' => [ 'ARN' => '<string>', 'Capacity' => <integer>, 'Description' => '<string>', 'Id' => '<string>', 'Name' => '<string>', 'Rules' => [ [ 'Action' => [ 'Allow' => [ ], 'Block' => [ ], 'Count' => [ ], ], 'Name' => '<string>', 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, 'Statement' => [ 'AndStatement' => [ 'Statements' => [ [...], // RECURSIVE // ... ], ], 'ByteMatchStatement' => [ 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'PositionalConstraint' => 'EXACTLY|STARTS_WITH|ENDS_WITH|CONTAINS|CONTAINS_WORD', 'SearchString' => <string || resource || Psr\Http\Message\StreamInterface>, 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'GeoMatchStatement' => [ 'CountryCodes' => ['<string>', ...], 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', 'HeaderName' => '<string>', ], ], 'IPSetReferenceStatement' => [ 'ARN' => '<string>', 'IPSetForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', 'HeaderName' => '<string>', 'Position' => 'FIRST|LAST|ANY', ], ], 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], 'Name' => '<string>', 'VendorName' => '<string>', ], 'NotStatement' => [ 'Statement' => [...], // RECURSIVE ], 'OrStatement' => [ 'Statements' => [ [...], // RECURSIVE // ... ], ], 'RateBasedStatement' => [ 'AggregateKeyType' => 'IP|FORWARDED_IP', 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', 'HeaderName' => '<string>', ], 'Limit' => <integer>, 'ScopeDownStatement' => [...], // RECURSIVE ], 'RegexPatternSetReferenceStatement' => [ 'ARN' => '<string>', 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], ], 'SizeConstraintStatement' => [ 'ComparisonOperator' => 'EQ|NE|LE|LT|GE|GT', 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'Size' => <integer>, 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'SqliMatchStatement' => [ 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'XssMatchStatement' => [ 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], ], 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], // ... ], 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], ]
Result Details
Members
- LockToken
-
- Type: 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. - RuleGroup
-
- Type: RuleGroup structure
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation isn't valid.
GetSampledRequests
$result = $client->getSampledRequests
([/* ... */]); $promise = $client->getSampledRequestsAsync
([/* ... */]);
Gets detailed information about a specified number of requests--a sample--that AWS WAF randomly selects from among the first 5,000 requests that your AWS resource received during a time range that you choose. You can specify a sample size of up to 500 requests, and you can specify any time range in the previous three hours.
GetSampledRequests
returns a time range, which is usually the time range that you specified. However, if your resource (such as a CloudFront distribution) received 5,000 requests before the specified time range elapsed, GetSampledRequests
returns an updated time range. This new time range indicates the actual period during which AWS WAF selected the requests in the sample.
Parameter Syntax
$result = $client->getSampledRequests([ 'MaxItems' => <integer>, // REQUIRED 'RuleMetricName' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED 'TimeWindow' => [ // REQUIRED 'EndTime' => <integer || string || DateTime>, // REQUIRED 'StartTime' => <integer || string || DateTime>, // REQUIRED ], 'WebAclArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
- MaxItems
-
- Required: Yes
- Type: long (int|float)
The number of requests that you want AWS WAF to return from among the first 5,000 requests that your AWS resource received during the time range. If your resource received fewer requests than the value of
MaxItems
,GetSampledRequests
returns information about all of them. - RuleMetricName
-
- Required: Yes
- Type: string
The metric name assigned to the
Rule
orRuleGroup
for which you want a sample of requests. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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.
- TimeWindow
-
- Required: Yes
- Type: TimeWindow structure
The start date and time and the end date and time of the range for which you want
GetSampledRequests
to return a sample of requests. You must specify the times in Coordinated Universal Time (UTC) format. UTC format includes the special designator,Z
. For example,"2016-09-27T14:50Z"
. You can specify any time range in the previous three hours. If you specify a start time that's earlier than three hours ago, AWS WAF sets it to three hours ago. - WebAclArn
-
- Required: Yes
- Type: string
The Amazon resource name (ARN) of the
WebACL
for which you want a sample of requests.
Result Syntax
[ 'PopulationSize' => <integer>, 'SampledRequests' => [ [ 'Action' => '<string>', 'Request' => [ 'ClientIP' => '<string>', 'Country' => '<string>', 'HTTPVersion' => '<string>', 'Headers' => [ [ 'Name' => '<string>', 'Value' => '<string>', ], // ... ], 'Method' => '<string>', 'URI' => '<string>', ], 'RuleNameWithinRuleGroup' => '<string>', 'Timestamp' => <DateTime>, 'Weight' => <integer>, ], // ... ], 'TimeWindow' => [ 'EndTime' => <DateTime>, 'StartTime' => <DateTime>, ], ]
Result Details
Members
- PopulationSize
-
- Type: long (int|float)
The total number of requests from which
GetSampledRequests
got a sample ofMaxItems
requests. IfPopulationSize
is less thanMaxItems
, the sample includes every request that your AWS resource received during the specified time range. - SampledRequests
-
- Type: Array of SampledHTTPRequest structures
A complex type that contains detailed information about each of the requests in the sample.
- TimeWindow
-
- Type: TimeWindow structure
Usually,
TimeWindow
is the time range that you specified in theGetSampledRequests
request. However, if your AWS resource received more than 5,000 requests during the time range that you specified in the request,GetSampledRequests
returns the time range for the first 5,000 requests. Times are in Coordinated Universal Time (UTC) format.
Errors
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
GetWebACL
$result = $client->getWebACL
([/* ... */]); $promise = $client->getWebACLAsync
([/* ... */]);
Retrieves the specified WebACL.
Parameter Syntax
$result = $client->getWebACL([ 'Id' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Id
-
- Required: Yes
- Type: string
The unique identifier for the Web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- Name
-
- Required: Yes
- Type: string
The name of the Web ACL. You cannot change the name of a Web ACL after you create it.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'LockToken' => '<string>', 'WebACL' => [ 'ARN' => '<string>', 'Capacity' => <integer>, 'DefaultAction' => [ 'Allow' => [ ], 'Block' => [ ], ], 'Description' => '<string>', 'Id' => '<string>', 'ManagedByFirewallManager' => true || false, 'Name' => '<string>', 'PostProcessFirewallManagerRuleGroups' => [ [ 'FirewallManagerStatement' => [ 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], 'Name' => '<string>', 'VendorName' => '<string>', ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], ], ], 'Name' => '<string>', 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], // ... ], 'PreProcessFirewallManagerRuleGroups' => [ [ 'FirewallManagerStatement' => [ 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], 'Name' => '<string>', 'VendorName' => '<string>', ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], ], ], 'Name' => '<string>', 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], // ... ], 'Rules' => [ [ 'Action' => [ 'Allow' => [ ], 'Block' => [ ], 'Count' => [ ], ], 'Name' => '<string>', 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, 'Statement' => [ 'AndStatement' => [ 'Statements' => [ [...], // RECURSIVE // ... ], ], 'ByteMatchStatement' => [ 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'PositionalConstraint' => 'EXACTLY|STARTS_WITH|ENDS_WITH|CONTAINS|CONTAINS_WORD', 'SearchString' => <string || resource || Psr\Http\Message\StreamInterface>, 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'GeoMatchStatement' => [ 'CountryCodes' => ['<string>', ...], 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', 'HeaderName' => '<string>', ], ], 'IPSetReferenceStatement' => [ 'ARN' => '<string>', 'IPSetForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', 'HeaderName' => '<string>', 'Position' => 'FIRST|LAST|ANY', ], ], 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], 'Name' => '<string>', 'VendorName' => '<string>', ], 'NotStatement' => [ 'Statement' => [...], // RECURSIVE ], 'OrStatement' => [ 'Statements' => [ [...], // RECURSIVE // ... ], ], 'RateBasedStatement' => [ 'AggregateKeyType' => 'IP|FORWARDED_IP', 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', 'HeaderName' => '<string>', ], 'Limit' => <integer>, 'ScopeDownStatement' => [...], // RECURSIVE ], 'RegexPatternSetReferenceStatement' => [ 'ARN' => '<string>', 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], ], 'SizeConstraintStatement' => [ 'ComparisonOperator' => 'EQ|NE|LE|LT|GE|GT', 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'Size' => <integer>, 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'SqliMatchStatement' => [ 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'XssMatchStatement' => [ 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], ], 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], // ... ], 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], ]
Result Details
Members
- LockToken
-
- Type: 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. - WebACL
-
- Type: WebACL structure
The Web ACL specification. You can modify the settings in this Web ACL and use it to update this Web ACL or create a new one.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation isn't valid.
GetWebACLForResource
$result = $client->getWebACLForResource
([/* ... */]); $promise = $client->getWebACLForResourceAsync
([/* ... */]);
Retrieves the WebACL for the specified resource.
Parameter Syntax
$result = $client->getWebACLForResource([ 'ResourceArn' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[ 'WebACL' => [ 'ARN' => '<string>', 'Capacity' => <integer>, 'DefaultAction' => [ 'Allow' => [ ], 'Block' => [ ], ], 'Description' => '<string>', 'Id' => '<string>', 'ManagedByFirewallManager' => true || false, 'Name' => '<string>', 'PostProcessFirewallManagerRuleGroups' => [ [ 'FirewallManagerStatement' => [ 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], 'Name' => '<string>', 'VendorName' => '<string>', ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], ], ], 'Name' => '<string>', 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], // ... ], 'PreProcessFirewallManagerRuleGroups' => [ [ 'FirewallManagerStatement' => [ 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], 'Name' => '<string>', 'VendorName' => '<string>', ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], ], ], 'Name' => '<string>', 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], // ... ], 'Rules' => [ [ 'Action' => [ 'Allow' => [ ], 'Block' => [ ], 'Count' => [ ], ], 'Name' => '<string>', 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, 'Statement' => [ 'AndStatement' => [ 'Statements' => [ [...], // RECURSIVE // ... ], ], 'ByteMatchStatement' => [ 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'PositionalConstraint' => 'EXACTLY|STARTS_WITH|ENDS_WITH|CONTAINS|CONTAINS_WORD', 'SearchString' => <string || resource || Psr\Http\Message\StreamInterface>, 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'GeoMatchStatement' => [ 'CountryCodes' => ['<string>', ...], 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', 'HeaderName' => '<string>', ], ], 'IPSetReferenceStatement' => [ 'ARN' => '<string>', 'IPSetForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', 'HeaderName' => '<string>', 'Position' => 'FIRST|LAST|ANY', ], ], 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], 'Name' => '<string>', 'VendorName' => '<string>', ], 'NotStatement' => [ 'Statement' => [...], // RECURSIVE ], 'OrStatement' => [ 'Statements' => [ [...], // RECURSIVE // ... ], ], 'RateBasedStatement' => [ 'AggregateKeyType' => 'IP|FORWARDED_IP', 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', 'HeaderName' => '<string>', ], 'Limit' => <integer>, 'ScopeDownStatement' => [...], // RECURSIVE ], 'RegexPatternSetReferenceStatement' => [ 'ARN' => '<string>', 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', 'ExcludedRules' => [ [ 'Name' => '<string>', ], // ... ], ], 'SizeConstraintStatement' => [ 'ComparisonOperator' => 'EQ|NE|LE|LT|GE|GT', 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'Size' => <integer>, 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'SqliMatchStatement' => [ 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], 'XssMatchStatement' => [ 'FieldToMatch' => [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], 'TextTransformations' => [ [ 'Priority' => <integer>, 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', ], // ... ], ], ], 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], // ... ], 'VisibilityConfig' => [ 'CloudWatchMetricsEnabled' => true || false, 'MetricName' => '<string>', 'SampledRequestsEnabled' => true || false, ], ], ]
Result Details
Members
- WebACL
-
- Type: WebACL structure
The Web ACL that is associated with the resource. If there is no associated resource, AWS WAF returns a null Web ACL.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
WAFUnavailableEntityException:
AWS WAF couldn’t retrieve the resource that you requested. Retry your request.
-
The operation isn't valid.
ListAvailableManagedRuleGroups
$result = $client->listAvailableManagedRuleGroups
([/* ... */]); $promise = $client->listAvailableManagedRuleGroupsAsync
([/* ... */]);
Retrieves an array of managed rule groups that are available for you to use. This list includes all AWS Managed Rules rule groups and the AWS Marketplace managed rule groups that you're subscribed to.
Parameter Syntax
$result = $client->listAvailableManagedRuleGroups([ 'Limit' => <integer>, 'NextMarker' => '<string>', 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Limit
-
- Type: int
The maximum number of objects that you want AWS WAF to return for this request. If more objects are available, in the response, AWS WAF provides a
NextMarker
value that you can use in a subsequent call to get the next batch of objects. - NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'ManagedRuleGroups' => [ [ 'Description' => '<string>', 'Name' => '<string>', 'VendorName' => '<string>', ], // ... ], 'NextMarker' => '<string>', ]
Result Details
Members
- ManagedRuleGroups
-
- Type: Array of ManagedRuleGroupSummary structures
- NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
ListIPSets
$result = $client->listIPSets
([/* ... */]); $promise = $client->listIPSetsAsync
([/* ... */]);
Retrieves an array of IPSetSummary objects for the IP sets that you manage.
Parameter Syntax
$result = $client->listIPSets([ 'Limit' => <integer>, 'NextMarker' => '<string>', 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Limit
-
- Type: int
The maximum number of objects that you want AWS WAF to return for this request. If more objects are available, in the response, AWS WAF provides a
NextMarker
value that you can use in a subsequent call to get the next batch of objects. - NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'IPSets' => [ [ 'ARN' => '<string>', 'Description' => '<string>', 'Id' => '<string>', 'LockToken' => '<string>', 'Name' => '<string>', ], // ... ], 'NextMarker' => '<string>', ]
Result Details
Members
- IPSets
-
- Type: Array of IPSetSummary structures
Array of IPSets. This may not be the full list of IPSets that you have defined. See the
Limit
specification for this request. - NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
ListLoggingConfigurations
$result = $client->listLoggingConfigurations
([/* ... */]); $promise = $client->listLoggingConfigurationsAsync
([/* ... */]);
Retrieves an array of your LoggingConfiguration objects.
Parameter Syntax
$result = $client->listLoggingConfigurations([ 'Limit' => <integer>, 'NextMarker' => '<string>', 'Scope' => 'CLOUDFRONT|REGIONAL', ]);
Parameter Details
Members
- Limit
-
- Type: int
The maximum number of objects that you want AWS WAF to return for this request. If more objects are available, in the response, AWS WAF provides a
NextMarker
value that you can use in a subsequent call to get the next batch of objects. - NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - Scope
-
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'LoggingConfigurations' => [ [ 'LogDestinationConfigs' => ['<string>', ...], 'ManagedByFirewallManager' => true || false, 'RedactedFields' => [ [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], // ... ], 'ResourceArn' => '<string>', ], // ... ], 'NextMarker' => '<string>', ]
Result Details
Members
- LoggingConfigurations
-
- Type: Array of LoggingConfiguration structures
- NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
ListRegexPatternSets
$result = $client->listRegexPatternSets
([/* ... */]); $promise = $client->listRegexPatternSetsAsync
([/* ... */]);
Retrieves an array of RegexPatternSetSummary objects for the regex pattern sets that you manage.
Parameter Syntax
$result = $client->listRegexPatternSets([ 'Limit' => <integer>, 'NextMarker' => '<string>', 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Limit
-
- Type: int
The maximum number of objects that you want AWS WAF to return for this request. If more objects are available, in the response, AWS WAF provides a
NextMarker
value that you can use in a subsequent call to get the next batch of objects. - NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'NextMarker' => '<string>', 'RegexPatternSets' => [ [ 'ARN' => '<string>', 'Description' => '<string>', 'Id' => '<string>', 'LockToken' => '<string>', 'Name' => '<string>', ], // ... ], ]
Result Details
Members
- NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - RegexPatternSets
-
- Type: Array of RegexPatternSetSummary structures
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
ListResourcesForWebACL
$result = $client->listResourcesForWebACL
([/* ... */]); $promise = $client->listResourcesForWebACLAsync
([/* ... */]);
Retrieves an array of the Amazon Resource Names (ARNs) for the regional resources that are associated with the specified web ACL. If you want the list of AWS CloudFront resources, use the AWS CloudFront call ListDistributionsByWebACLId
.
Parameter Syntax
$result = $client->listResourcesForWebACL([ 'ResourceType' => 'APPLICATION_LOAD_BALANCER|API_GATEWAY|APPSYNC', 'WebACLArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'ResourceArns' => ['<string>', ...], ]
Result Details
Members
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
ListRuleGroups
$result = $client->listRuleGroups
([/* ... */]); $promise = $client->listRuleGroupsAsync
([/* ... */]);
Retrieves an array of RuleGroupSummary objects for the rule groups that you manage.
Parameter Syntax
$result = $client->listRuleGroups([ 'Limit' => <integer>, 'NextMarker' => '<string>', 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Limit
-
- Type: int
The maximum number of objects that you want AWS WAF to return for this request. If more objects are available, in the response, AWS WAF provides a
NextMarker
value that you can use in a subsequent call to get the next batch of objects. - NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'NextMarker' => '<string>', 'RuleGroups' => [ [ 'ARN' => '<string>', 'Description' => '<string>', 'Id' => '<string>', 'LockToken' => '<string>', 'Name' => '<string>', ], // ... ], ]
Result Details
Members
- NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - RuleGroups
-
- Type: Array of RuleGroupSummary structures
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
ListTagsForResource
$result = $client->listTagsForResource
([/* ... */]); $promise = $client->listTagsForResourceAsync
([/* ... */]);
Retrieves the TagInfoForResource for the specified resource. Tags are key:value pairs that you can use to categorize and manage your resources, for purposes like billing. For example, you might set the tag key to "customer" and the value to the customer name or ID. You can specify one or more tags to add to each AWS resource, up to 50 tags for a resource.
You can tag the AWS resources that you manage through AWS WAF: web ACLs, rule groups, IP sets, and regex pattern sets. You can't manage or view tags through the AWS WAF console.
Parameter Syntax
$result = $client->listTagsForResource([ 'Limit' => <integer>, 'NextMarker' => '<string>', 'ResourceARN' => '<string>', // REQUIRED ]);
Parameter Details
Members
- Limit
-
- Type: int
The maximum number of objects that you want AWS WAF to return for this request. If more objects are available, in the response, AWS WAF provides a
NextMarker
value that you can use in a subsequent call to get the next batch of objects. - NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - ResourceARN
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the resource.
Result Syntax
[ 'NextMarker' => '<string>', 'TagInfoForResource' => [ 'ResourceARN' => '<string>', 'TagList' => [ [ 'Key' => '<string>', 'Value' => '<string>', ], // ... ], ], ]
Result Details
Members
- NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - TagInfoForResource
-
- Type: TagInfoForResource structure
The collection of tagging definitions for the resource.
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
ListWebACLs
$result = $client->listWebACLs
([/* ... */]); $promise = $client->listWebACLsAsync
([/* ... */]);
Retrieves an array of WebACLSummary objects for the web ACLs that you manage.
Parameter Syntax
$result = $client->listWebACLs([ 'Limit' => <integer>, 'NextMarker' => '<string>', 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Limit
-
- Type: int
The maximum number of objects that you want AWS WAF to return for this request. If more objects are available, in the response, AWS WAF provides a
NextMarker
value that you can use in a subsequent call to get the next batch of objects. - NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'NextMarker' => '<string>', 'WebACLs' => [ [ 'ARN' => '<string>', 'Description' => '<string>', 'Id' => '<string>', 'LockToken' => '<string>', 'Name' => '<string>', ], // ... ], ]
Result Details
Members
- NextMarker
-
- Type: string
When you request a list of objects with a
Limit
setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns aNextMarker
value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. - WebACLs
-
- Type: Array of WebACLSummary structures
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
PutLoggingConfiguration
$result = $client->putLoggingConfiguration
([/* ... */]); $promise = $client->putLoggingConfigurationAsync
([/* ... */]);
Enables the specified LoggingConfiguration, to start logging from a web ACL, according to the configuration provided.
You can access information about all traffic that AWS WAF inspects using the following steps:
-
Create an Amazon Kinesis Data Firehose.
Create the data firehose with a PUT source and in the Region that you are operating. If you are capturing logs for Amazon CloudFront, always create the firehose in US East (N. Virginia).
Give the data firehose a name that starts with the prefix
aws-waf-logs-
. For example,aws-waf-logs-us-east-2-analytics
.Do not create the data firehose using a
Kinesis stream
as your source. -
Associate that firehose to your web ACL using a
PutLoggingConfiguration
request.
When you successfully enable logging using a PutLoggingConfiguration
request, AWS WAF will create a service linked role with the necessary permissions to write logs to the Amazon Kinesis Data Firehose. For more information, see Logging Web ACL Traffic Information in the AWS WAF Developer Guide.
Parameter Syntax
$result = $client->putLoggingConfiguration([ 'LoggingConfiguration' => [ // REQUIRED 'LogDestinationConfigs' => ['<string>', ...], // REQUIRED 'ManagedByFirewallManager' => true || false, 'RedactedFields' => [ [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], // ... ], 'ResourceArn' => '<string>', // REQUIRED ], ]);
Parameter Details
Members
- LoggingConfiguration
-
- Required: Yes
- Type: LoggingConfiguration structure
Result Syntax
[ 'LoggingConfiguration' => [ 'LogDestinationConfigs' => ['<string>', ...], 'ManagedByFirewallManager' => true || false, 'RedactedFields' => [ [ 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', ], 'SingleQueryArgument' => [ 'Name' => '<string>', ], 'UriPath' => [ ], ], // ... ], 'ResourceArn' => '<string>', ], ]
Result Details
Members
- LoggingConfiguration
-
- Type: LoggingConfiguration structure
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
WAFServiceLinkedRoleErrorException:
AWS WAF is not able to access the service linked role. This can be caused by a previous
PutLoggingConfiguration
request, which can lock the service linked role for about 20 seconds. Please try your request again. The service linked role can also be locked by a previousDeleteServiceLinkedRole
request, which can lock the role for 15 minutes or more. If you recently made a call toDeleteServiceLinkedRole
, wait at least 15 minutes and try the request again. If you receive this same exception again, you will have to wait additional time until the role is unlocked. -
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
The operation isn't valid.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide.
PutPermissionPolicy
$result = $client->putPermissionPolicy
([/* ... */]); $promise = $client->putPermissionPolicyAsync
([/* ... */]);
Attaches an IAM policy to the specified resource. Use this to share a rule group across accounts.
You must be the owner of the rule group to perform this operation.
This action is subject to the following restrictions:
-
You can attach only one policy with each
PutPermissionPolicy
request. -
The ARN in the request must be a valid WAF RuleGroup ARN and the rule group must exist in the same region.
-
The user making the request must be the owner of the rule group.
Parameter Syntax
$result = $client->putPermissionPolicy([ 'Policy' => '<string>', // REQUIRED 'ResourceArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
- Policy
-
- Required: Yes
- Type: string
The policy to attach to the specified rule group.
The policy specifications must conform to the following:
-
The policy must be composed using IAM Policy version 2012-10-17 or version 2015-01-01.
-
The policy must include specifications for
Effect
,Action
, andPrincipal
. -
Effect
must specifyAllow
. -
Action
must specifywafv2:CreateWebACL
,wafv2:UpdateWebACL
, andwafv2:PutFirewallManagerRuleGroups
. AWS WAF rejects any extra actions or wildcard actions in the policy. -
The policy must not include a
Resource
parameter.
For more information, see IAM Policies.
- ResourceArn
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the RuleGroup to which you want to attach the policy.
Result Syntax
[]
Result Details
Errors
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
WAFInvalidPermissionPolicyException:
The operation failed because the specified policy isn't in the proper format.
The policy specifications must conform to the following:
-
The policy must be composed using IAM Policy version 2012-10-17 or version 2015-01-01.
-
The policy must include specifications for
Effect
,Action
, andPrincipal
. -
Effect
must specifyAllow
. -
Action
must specifywafv2:CreateWebACL
,wafv2:UpdateWebACL
, andwafv2:PutFirewallManagerRuleGroups
. AWS WAF rejects any extra actions or wildcard actions in the policy. -
The policy must not include a
Resource
parameter.
For more information, see IAM Policies.
-
TagResource
$result = $client->tagResource
([/* ... */]); $promise = $client->tagResourceAsync
([/* ... */]);
Associates tags with the specified AWS resource. Tags are key:value pairs that you can use to categorize and manage your resources, for purposes like billing. For example, you might set the tag key to "customer" and the value to the customer name or ID. You can specify one or more tags to add to each AWS resource, up to 50 tags for a resource.
You can tag the AWS resources that you manage through AWS WAF: web ACLs, rule groups, IP sets, and regex pattern sets. You can't manage or view tags through the AWS WAF console.
Parameter Syntax
$result = $client->tagResource([ 'ResourceARN' => '<string>', // REQUIRED 'Tags' => [ // REQUIRED [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', // REQUIRED ], // ... ], ]);
Parameter Details
Members
- ResourceARN
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the resource.
- Tags
-
- Required: Yes
- Type: Array of Tag structures
An array of key:value pairs to associate with the resource.
Result Syntax
[]
Result Details
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
UntagResource
$result = $client->untagResource
([/* ... */]); $promise = $client->untagResourceAsync
([/* ... */]);
Disassociates tags from an AWS resource. Tags are key:value pairs that you can associate with AWS resources. For example, the tag key might be "customer" and the tag value might be "companyA." You can specify one or more tags to add to each container. You can add up to 50 tags to each AWS resource.
Parameter Syntax
$result = $client->untagResource([ 'ResourceARN' => '<string>', // REQUIRED 'TagKeys' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
An error occurred during the tagging operation. Retry your request.
-
WAFTagOperationInternalErrorException:
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
-
The operation isn't valid.
UpdateIPSet
$result = $client->updateIPSet
([/* ... */]); $promise = $client->updateIPSetAsync
([/* ... */]);
Updates the specified IPSet.
Parameter Syntax
$result = $client->updateIPSet([ 'Addresses' => ['<string>', ...], // REQUIRED 'Description' => '<string>', 'Id' => '<string>', // REQUIRED 'LockToken' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Addresses
-
- Required: Yes
- Type: Array of strings
Contains an array of strings that specify one or more IP addresses or blocks of IP addresses in Classless Inter-Domain Routing (CIDR) notation. AWS WAF supports all address ranges for IP versions IPv4 and IPv6.
Examples:
-
To configure AWS WAF to allow, block, or count requests that originated from the IP address 192.0.2.44, specify
192.0.2.44/32
. -
To configure AWS WAF to allow, block, or count requests that originated from IP addresses from 192.0.2.0 to 192.0.2.255, specify
192.0.2.0/24
. -
To configure AWS WAF to allow, block, or count 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
. -
To configure AWS WAF to allow, block, or count 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.
- Description
-
- Type: string
A description of the IP set that helps with identification.
- Id
-
- Required: Yes
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- LockToken
-
- Required: Yes
- Type: 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. - Name
-
- Required: Yes
- Type: string
The name of the IP set. You cannot change the name of an
IPSet
after you create it. - Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'NextLockToken' => '<string>', ]
Result Details
Members
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
The operation isn't valid.
UpdateRegexPatternSet
$result = $client->updateRegexPatternSet
([/* ... */]); $promise = $client->updateRegexPatternSetAsync
([/* ... */]);
Updates the specified RegexPatternSet.
Parameter Syntax
$result = $client->updateRegexPatternSet([ 'Description' => '<string>', 'Id' => '<string>', // REQUIRED 'LockToken' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'RegularExpressionList' => [ // REQUIRED [ 'RegexString' => '<string>', ], // ... ], 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED ]);
Parameter Details
Members
- Description
-
- Type: string
A description of the set that helps with identification.
- Id
-
- Required: Yes
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- LockToken
-
- Required: Yes
- Type: 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. - Name
-
- Required: Yes
- Type: string
The name of the set. You cannot change the name after you create the set.
- RegularExpressionList
-
- Required: Yes
- Type: Array of Regex structures
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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
[ 'NextLockToken' => '<string>', ]
Result Details
Members
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
The operation isn't valid.
UpdateRuleGroup
$result = $client->updateRuleGroup
([/* ... */]); $promise = $client->updateRuleGroupAsync
([/* ... */]);
Updates the specified RuleGroup.
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.
Parameter Syntax
$result = $client->updateRuleGroup([ 'Description' => '<string>', 'Id' => '<string>', // REQUIRED 'LockToken' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Rules' => [ [ 'Action' => [ 'Allow' => [ ], 'Block' => [ ], 'Count' => [ ], ], 'Name' => '<string>', // REQUIRED 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, // REQUIRED 'Statement' => [ // REQUIRED 'AndStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'ByteMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'PositionalConstraint' => 'EXACTLY|STARTS_WITH|ENDS_WITH|CONTAINS|CONTAINS_WORD', // 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', // 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 ], ], 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], 'Name' => '<string>', // REQUIRED 'VendorName' => '<string>', // REQUIRED ], 'NotStatement' => [ 'Statement' => [...], // REQUIRED, RECURSIVE ], 'OrStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'RateBasedStatement' => [ 'AggregateKeyType' => 'IP|FORWARDED_IP', // REQUIRED 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED 'HeaderName' => '<string>', // REQUIRED ], 'Limit' => <integer>, // REQUIRED 'ScopeDownStatement' => [...], // RECURSIVE ], 'RegexPatternSetReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], ], 'SizeConstraintStatement' => [ 'ComparisonOperator' => 'EQ|NE|LE|LT|GE|GT', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'Size' => <integer>, // REQUIRED 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'SqliMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'XssMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], ], 'VisibilityConfig' => [ // REQUIRED 'CloudWatchMetricsEnabled' => true || false, // REQUIRED 'MetricName' => '<string>', // REQUIRED 'SampledRequestsEnabled' => true || false, // REQUIRED ], ], // ... ], 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED 'VisibilityConfig' => [ // REQUIRED 'CloudWatchMetricsEnabled' => true || false, // REQUIRED 'MetricName' => '<string>', // REQUIRED 'SampledRequestsEnabled' => true || false, // REQUIRED ], ]);
Parameter Details
Members
- Description
-
- Type: string
A description of the rule group that helps with identification.
- Id
-
- Required: Yes
- Type: 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.
- LockToken
-
- Required: Yes
- Type: 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. - Name
-
- Required: Yes
- Type: string
The name of the rule group. You cannot change the name of a rule group after you create it.
- Rules
-
- Type: Array of Rule structures
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.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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.
- VisibilityConfig
-
- Required: Yes
- Type: VisibilityConfig structure
Defines and enables Amazon CloudWatch metrics and web request sample collection.
Result Syntax
[ 'NextLockToken' => '<string>', ]
Result Details
Members
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
WAFUnavailableEntityException:
AWS WAF couldn’t retrieve the resource that you requested. Retry your request.
-
The operation isn't valid.
UpdateWebACL
$result = $client->updateWebACL
([/* ... */]); $promise = $client->updateWebACLAsync
([/* ... */]);
Updates the specified WebACL.
A Web ACL defines a collection of rules to use to inspect and control web requests. Each rule has an action defined (allow, block, or count) for requests that match the statement of the rule. In the Web ACL, you assign a default action to take (allow, block) for any request that does not match any of the rules. The rules in a Web ACL can be a combination of the types Rule, RuleGroup, and managed rule group. You can associate a Web ACL with one or more AWS resources to protect. The resources can be Amazon CloudFront, an Amazon API Gateway REST API, an Application Load Balancer, or an AWS AppSync GraphQL API.
Parameter Syntax
$result = $client->updateWebACL([ 'DefaultAction' => [ // REQUIRED 'Allow' => [ ], 'Block' => [ ], ], 'Description' => '<string>', 'Id' => '<string>', // REQUIRED 'LockToken' => '<string>', // REQUIRED 'Name' => '<string>', // REQUIRED 'Rules' => [ [ 'Action' => [ 'Allow' => [ ], 'Block' => [ ], 'Count' => [ ], ], 'Name' => '<string>', // REQUIRED 'OverrideAction' => [ 'Count' => [ ], 'None' => [ ], ], 'Priority' => <integer>, // REQUIRED 'Statement' => [ // REQUIRED 'AndStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'ByteMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'PositionalConstraint' => 'EXACTLY|STARTS_WITH|ENDS_WITH|CONTAINS|CONTAINS_WORD', // 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', // 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 ], ], 'ManagedRuleGroupStatement' => [ 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], 'Name' => '<string>', // REQUIRED 'VendorName' => '<string>', // REQUIRED ], 'NotStatement' => [ 'Statement' => [...], // REQUIRED, RECURSIVE ], 'OrStatement' => [ 'Statements' => [ // REQUIRED [...], // RECURSIVE // ... ], ], 'RateBasedStatement' => [ 'AggregateKeyType' => 'IP|FORWARDED_IP', // REQUIRED 'ForwardedIPConfig' => [ 'FallbackBehavior' => 'MATCH|NO_MATCH', // REQUIRED 'HeaderName' => '<string>', // REQUIRED ], 'Limit' => <integer>, // REQUIRED 'ScopeDownStatement' => [...], // RECURSIVE ], 'RegexPatternSetReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'RuleGroupReferenceStatement' => [ 'ARN' => '<string>', // REQUIRED 'ExcludedRules' => [ [ 'Name' => '<string>', // REQUIRED ], // ... ], ], 'SizeConstraintStatement' => [ 'ComparisonOperator' => 'EQ|NE|LE|LT|GE|GT', // REQUIRED 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'Size' => <integer>, // REQUIRED 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'SqliMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], 'XssMatchStatement' => [ 'FieldToMatch' => [ // REQUIRED 'AllQueryArguments' => [ ], 'Body' => [ ], 'JsonBody' => [ 'InvalidFallbackBehavior' => 'MATCH|NO_MATCH|EVALUATE_AS_STRING', 'MatchPattern' => [ // REQUIRED 'All' => [ ], 'IncludedPaths' => ['<string>', ...], ], 'MatchScope' => 'ALL|KEY|VALUE', // REQUIRED ], 'Method' => [ ], 'QueryString' => [ ], 'SingleHeader' => [ 'Name' => '<string>', // REQUIRED ], 'SingleQueryArgument' => [ 'Name' => '<string>', // REQUIRED ], 'UriPath' => [ ], ], 'TextTransformations' => [ // REQUIRED [ 'Priority' => <integer>, // REQUIRED 'Type' => 'NONE|COMPRESS_WHITE_SPACE|HTML_ENTITY_DECODE|LOWERCASE|CMD_LINE|URL_DECODE', // REQUIRED ], // ... ], ], ], 'VisibilityConfig' => [ // REQUIRED 'CloudWatchMetricsEnabled' => true || false, // REQUIRED 'MetricName' => '<string>', // REQUIRED 'SampledRequestsEnabled' => true || false, // REQUIRED ], ], // ... ], 'Scope' => 'CLOUDFRONT|REGIONAL', // REQUIRED 'VisibilityConfig' => [ // REQUIRED 'CloudWatchMetricsEnabled' => true || false, // REQUIRED 'MetricName' => '<string>', // REQUIRED 'SampledRequestsEnabled' => true || false, // REQUIRED ], ]);
Parameter Details
Members
- DefaultAction
-
- Required: Yes
- Type: DefaultAction structure
The action to perform if none of the
Rules
contained in theWebACL
match. - Description
-
- Type: string
A description of the Web ACL that helps with identification.
- Id
-
- Required: Yes
- Type: string
The unique identifier for the Web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- LockToken
-
- Required: Yes
- Type: 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. - Name
-
- Required: Yes
- Type: string
The name of the Web ACL. You cannot change the name of a Web ACL after you create it.
- Rules
-
- Type: Array of Rule structures
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.
- Scope
-
- Required: Yes
- Type: 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), an API Gateway REST API, or an AppSync GraphQL API.
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.
- VisibilityConfig
-
- Required: Yes
- Type: VisibilityConfig structure
Defines and enables Amazon CloudWatch metrics and web request sample collection.
Result Syntax
[ 'NextLockToken' => '<string>', ]
Result Details
Members
Errors
-
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
-
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
-
-
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
-
AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
-
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
-
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide. -
AWS WAF couldn’t perform the operation because the resource that you requested isn’t valid. Check the resource, and try again.
-
WAFUnavailableEntityException:
AWS WAF couldn’t retrieve the resource that you requested. Retry your request.
-
The operation isn't valid.
Shapes
All
Description
Inspect all of the elements that AWS WAF has parsed and extracted from the web request JSON body that are within the JsonBody MatchScope
. This is used with the FieldToMatch option JsonBody
.
This is used only to indicate the web request component for AWS WAF to inspect, in the FieldToMatch specification.
Members
AllQueryArguments
Description
All query arguments of a web request.
This is used only to indicate the web request component for AWS WAF to inspect, in the FieldToMatch specification.
Members
AllowAction
Description
Specifies that AWS WAF should allow requests.
This is used only in the context of other settings, for example to specify values for RuleAction and web ACL DefaultAction.
Members
AndStatement
Description
A logical rule statement used to combine other rule statements with AND logic. You provide more than one Statement within the AndStatement
.
Members
- Statements
-
- Required: Yes
- Type: Array of Statement structures
The statements to combine with AND logic. You can use any statements that can be nested.
BlockAction
Description
Specifies that AWS WAF should block requests.
This is used only in the context of other settings, for example to specify values for RuleAction and web ACL DefaultAction.
Members
Body
Description
The body of a web request. This immediately follows the request headers.
This is used only to indicate the web request component for AWS WAF to inspect, in the FieldToMatch specification.
Members
ByteMatchStatement
Description
A rule statement that defines a string match search for AWS WAF to apply to web requests. The byte match statement provides the bytes to search for, the location in requests that you want AWS WAF to search, and other settings. The bytes to search for are typically a string that corresponds with ASCII characters. In the AWS WAF console and the developer guide, this is refered to as a string match statement.
Members
- FieldToMatch
-
- Required: Yes
- Type: FieldToMatch structure
The part of a web request that you want AWS WAF to inspect. For more information, see FieldToMatch.
- PositionalConstraint
-
- Required: Yes
- Type: string
The area within the portion of a web request that you want AWS WAF to search for
SearchString
. Valid values include the following:CONTAINS
The specified part of the web request must include the value of
SearchString
, but the location doesn't matter.CONTAINS_WORD
The specified part of the web request must include the value of
SearchString
, andSearchString
must contain only alphanumeric characters or underscore (A-Z, a-z, 0-9, or _). In addition,SearchString
must be a word, which means that both of the following are true:-
SearchString
is at the beginning of the specified part of the web request or is preceded by a character other than an alphanumeric character or underscore (_). Examples include the value of a header and;BadBot
. -
SearchString
is at the end of the specified part of the web request or is followed by a character other than an alphanumeric character or underscore (_), for example,BadBot;
and-BadBot;
.
EXACTLY
The value of the specified part of the web request must exactly match the value of
SearchString
.STARTS_WITH
The value of
SearchString
must appear at the beginning of the specified part of the web request.ENDS_WITH
The value of
SearchString
must appear at the end of the specified part of the web request. - SearchString
-
- Required: Yes
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
A string value that you want AWS WAF to search for. AWS WAF searches only in the part of web requests that you designate for inspection in FieldToMatch. The maximum length of the value is 50 bytes.
Valid values depend on the component that you specify for inspection in
FieldToMatch
:-
Method
: The HTTP method that you want AWS WAF to search for. This indicates the type of operation specified in the request. -
UriPath
: The value that you want AWS WAF to search for in the URI path, for example,/images/daily-ad.jpg
.
If
SearchString
includes alphabetic characters A-Z and a-z, note that the value is case sensitive.If you're using the AWS WAF API
Specify a base64-encoded version of the value. The maximum length of the value before you base64-encode it is 50 bytes.
For example, suppose the value of
Type
isHEADER
and the value ofData
isUser-Agent
. If you want to search theUser-Agent
header for the valueBadBot
, you base64-encodeBadBot
using MIME base64-encoding and include the resulting value,QmFkQm90
, in the value ofSearchString
.If you're using the AWS CLI or one of the AWS SDKs
The value that you want AWS WAF to search for. The SDK automatically base64 encodes the value.
- TextTransformations
-
- Required: Yes
- Type: Array of TextTransformation structures
Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by
FieldToMatch
, starting from the lowest priority setting, before inspecting the content for a match.
CountAction
Description
Specifies that AWS WAF should count requests.
This is used only in the context of other settings, for example to specify values for RuleAction and web ACL DefaultAction.
Members
DefaultAction
Description
In a WebACL, this is the action that you want AWS WAF to perform when a web request doesn't match any of the rules in the WebACL
. The default action must be a terminating action, so count is not allowed.
Members
- Allow
-
- Type: AllowAction structure
Specifies that AWS WAF should allow requests by default.
- Block
-
- Type: BlockAction structure
Specifies that AWS WAF should block requests by default.
ExcludedRule
Description
Specifies a single rule to exclude from the rule group. Excluding a rule overrides its action setting for the rule group in the web ACL, setting it to COUNT
. This effectively excludes the rule from acting on web requests.
Members
FieldToMatch
Description
The part of a web request that you want AWS WAF to inspect. Include the single FieldToMatch
type that you want to inspect, with additional specifications as needed, according to the type. You specify a single request component in FieldToMatch
for each rule statement that requires it. To inspect more than one component of a web request, create a separate rule statement for each component.
Members
- AllQueryArguments
-
- Type: AllQueryArguments structure
Inspect all query arguments.
- Body
-
- Type: Body structure
Inspect the request body as plain text. The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form.
Note that only the first 8 KB (8192 bytes) of the request body are forwarded to AWS WAF for inspection by the underlying host service. If you don't need to inspect more than 8 KB, you can guarantee that you don't allow additional bytes in by combining a statement that inspects the body of the web request, such as ByteMatchStatement or RegexPatternSetReferenceStatement, with a SizeConstraintStatement that enforces an 8 KB size limit on the body of the request. AWS WAF doesn't support inspecting the entire contents of web requests whose bodies exceed the 8 KB limit.
- JsonBody
-
- Type: JsonBody structure
Inspect the request body as JSON. The request body immediately follows the request headers. This is the part of a request that contains any additional data that you want to send to your web server as the HTTP request body, such as data from a form.
Note that only the first 8 KB (8192 bytes) of the request body are forwarded to AWS WAF for inspection by the underlying host service. If you don't need to inspect more than 8 KB, you can guarantee that you don't allow additional bytes in by combining a statement that inspects the body of the web request, such as ByteMatchStatement or RegexPatternSetReferenceStatement, with a SizeConstraintStatement that enforces an 8 KB size limit on the body of the request. AWS WAF doesn't support inspecting the entire contents of web requests whose bodies exceed the 8 KB limit.
- Method
-
- Type: Method structure
Inspect the HTTP method. The method indicates the type of operation that the request is asking the origin to perform.
- QueryString
-
- Type: QueryString structure
Inspect the query string. This is the part of a URL that appears after a
?
character, if any. - SingleHeader
-
- Type: SingleHeader structure
Inspect a single header. Provide the name of the header to inspect, for example,
User-Agent
orReferer
. This setting isn't case sensitive. - SingleQueryArgument
-
- Type: SingleQueryArgument structure
Inspect a single query argument. Provide the name of the query argument to inspect, such as UserName or SalesRegion. The name can be up to 30 characters long and isn't case sensitive.
This is used only to indicate the web request component for AWS WAF to inspect, in the FieldToMatch specification.
- UriPath
-
- Type: UriPath structure
Inspect the request URI path. This is the part of a web request that identifies a resource, for example,
/images/daily-ad.jpg
.
FirewallManagerRuleGroup
Description
A rule group that's defined for an AWS Firewall Manager WAF policy.
Members
- FirewallManagerStatement
-
- Required: Yes
- Type: FirewallManagerStatement structure
The processing guidance for an AWS Firewall Manager rule. This is like a regular rule Statement, but it can only contain a rule group reference.
- Name
-
- Required: Yes
- Type: string
The name of the rule group. You cannot change the name of a rule group after you create it.
- OverrideAction
-
- Required: Yes
- Type: OverrideAction structure
The override action to apply to the rules in a rule group. Used only for rule statements that reference a rule group, like
RuleGroupReferenceStatement
andManagedRuleGroupStatement
.Set the override action to none to leave the rule actions in effect. Set it to count to only count matches, regardless of the rule action settings.
In a Rule, you must specify either this
OverrideAction
setting or the ruleAction
setting, but not both:-
If the rule statement references a rule group, use this override action setting and not the action setting.
-
If the rule statement does not reference a rule group, use the rule action setting and not this rule override action setting.
- Priority
-
- Required: Yes
- Type: int
If you define more than one rule group in the first or last Firewall Manager rule groups, AWS WAF evaluates each request against the rule groups in order, starting from the lowest priority setting. The priorities don't need to be consecutive, but they must all be different.
- VisibilityConfig
-
- Required: Yes
- Type: VisibilityConfig structure
Defines and enables Amazon CloudWatch metrics and web request sample collection.
FirewallManagerStatement
Description
The processing guidance for an AWS Firewall Manager rule. This is like a regular rule Statement, but it can only contain a rule group reference.
Members
- ManagedRuleGroupStatement
-
- Type: ManagedRuleGroupStatement structure
A rule statement used to run the rules that are defined in a managed rule group. To use this, provide the vendor name and the name of the rule group in this statement. You can retrieve the required names by calling ListAvailableManagedRuleGroups.
You can't nest a
ManagedRuleGroupStatement
, for example for use inside aNotStatement
orOrStatement
. It can only be referenced as a top-level statement within a rule. - RuleGroupReferenceStatement
-
- Type: RuleGroupReferenceStatement structure
A rule statement used to run the rules that are defined in a RuleGroup. To use this, create a rule group with your rules, then provide the ARN of the rule group in this statement.
You cannot nest a
RuleGroupReferenceStatement
, for example for use inside aNotStatement
orOrStatement
. It can only be referenced as a top-level statement within a rule.
ForwardedIPConfig
Description
The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name.
If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
This configuration is used for GeoMatchStatement and RateBasedStatement. For IPSetReferenceStatement, use IPSetForwardedIPConfig instead.
AWS WAF only evaluates the first IP address found in the specified HTTP header.
Members
- FallbackBehavior
-
- Required: Yes
- Type: string
The match status to assign to the web request if the request doesn't have a valid IP address in the specified position.
If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
You can specify the following fallback behaviors:
-
MATCH
- Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. -
NO_MATCH
- Treat the web request as not matching the rule statement.
- HeaderName
-
- Required: Yes
- Type: string
The name of the HTTP header to use for the IP address. For example, to use the X-Forwarded-For (XFF) header, set this to
X-Forwarded-For
.If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
GeoMatchStatement
Description
A rule statement used to identify web requests based on country of origin.
Members
- CountryCodes
-
- Type: Array of strings
An array of two-character country codes, for example,
[ "US", "CN" ]
, from the alpha-2 country ISO codes of the ISO 3166 international standard. - ForwardedIPConfig
-
- Type: ForwardedIPConfig structure
The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name.
If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
HTTPHeader
Description
Part of the response from GetSampledRequests. This is a complex type that appears as Headers
in the response syntax. HTTPHeader
contains the names and values of all of the headers that appear in one of the web requests.
Members
HTTPRequest
Description
Part of the response from GetSampledRequests. This is a complex type that appears as Request
in the response syntax. HTTPRequest
contains information about one of the web requests.
Members
- ClientIP
-
- Type: string
The IP address that the request originated from. If the web ACL is associated with a CloudFront distribution, this is the value of one of the following fields in CloudFront access logs:
-
c-ip
, if the viewer did not use an HTTP proxy or a load balancer to send the request -
x-forwarded-for
, if the viewer did use an HTTP proxy or a load balancer to send the request
- Country
-
- Type: string
The two-letter country code for the country that the request originated from. For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2.
- HTTPVersion
-
- Type: string
The HTTP version specified in the sampled web request, for example,
HTTP/1.1
. - Headers
-
- Type: Array of HTTPHeader structures
A complex type that contains the name and value for each header in the sampled web request.
- Method
-
- Type: string
The HTTP method specified in the sampled web request.
- URI
-
- Type: string
The URI path of the request, which identifies the resource, for example,
/images/daily-ad.jpg
.
IPSet
Description
Contains one or more IP addresses or blocks of IP addresses specified in Classless Inter-Domain Routing (CIDR) notation. AWS WAF supports any CIDR range. For information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.
AWS WAF assigns an ARN to each IPSet
that you create. To use an IP set in a rule, you provide the ARN to the Rule statement IPSetReferenceStatement.
Members
- ARN
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the entity.
- Addresses
-
- Required: Yes
- Type: Array of strings
Contains an array of strings that specify one or more IP addresses or blocks of IP addresses in Classless Inter-Domain Routing (CIDR) notation. AWS WAF supports all address ranges for IP versions IPv4 and IPv6.
Examples:
-
To configure AWS WAF to allow, block, or count requests that originated from the IP address 192.0.2.44, specify
192.0.2.44/32
. -
To configure AWS WAF to allow, block, or count requests that originated from IP addresses from 192.0.2.0 to 192.0.2.255, specify
192.0.2.0/24
. -
To configure AWS WAF to allow, block, or count 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
. -
To configure AWS WAF to allow, block, or count 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.
- Description
-
- Type: string
A description of the IP set that helps with identification.
- IPAddressVersion
-
- Required: Yes
- Type: string
Specify IPV4 or IPV6.
- Id
-
- Required: Yes
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- Name
-
- Required: Yes
- Type: string
The name of the IP set. You cannot change the name of an
IPSet
after you create it.
IPSetForwardedIPConfig
Description
The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name.
If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
This configuration is used only for IPSetReferenceStatement. For GeoMatchStatement and RateBasedStatement, use ForwardedIPConfig instead.
Members
- FallbackBehavior
-
- Required: Yes
- Type: string
The match status to assign to the web request if the request doesn't have a valid IP address in the specified position.
If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
You can specify the following fallback behaviors:
-
MATCH
- Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. -
NO_MATCH
- Treat the web request as not matching the rule statement.
- HeaderName
-
- Required: Yes
- Type: string
The name of the HTTP header to use for the IP address. For example, to use the X-Forwarded-For (XFF) header, set this to
X-Forwarded-For
.If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
- Position
-
- Required: Yes
- Type: string
The position in the header to search for the IP address. The header can contain IP addresses of the original client and also of proxies. For example, the header value could be
10.1.1.1, 127.0.0.0, 10.10.10.10
where the first IP address identifies the original client and the rest identify proxies that the request went through.The options for this setting are the following:
-
FIRST - Inspect the first IP address in the list of IP addresses in the header. This is usually the client's original IP.
-
LAST - Inspect the last IP address in the list of IP addresses in the header.
-
ANY - Inspect all IP addresses in the header for a match. If the header contains more than 10 IP addresses, AWS WAF inspects the last 10.
IPSetReferenceStatement
Description
A rule statement used to detect web requests coming from particular IP addresses or address ranges. To use this, create an IPSet that specifies the addresses you want to detect, then use the ARN of that set in this statement. To create an IP set, see CreateIPSet.
Each IP set rule statement references an IP set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.
Members
- ARN
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the IPSet that this statement references.
- IPSetForwardedIPConfig
-
- Type: IPSetForwardedIPConfig structure
The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name.
If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
IPSetSummary
Description
High-level information about an IPSet, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage an IPSet
, and the ARN, that you provide to the IPSetReferenceStatement to use the address set in a Rule.
Members
- ARN
-
- Type: string
The Amazon Resource Name (ARN) of the entity.
- Description
-
- Type: string
A description of the IP set that helps with identification.
- Id
-
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- LockToken
-
- Type: 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. - Name
-
- Type: string
The name of the IP set. You cannot change the name of an
IPSet
after you create it.
JsonBody
Description
The body of a web request, inspected as JSON. The body immediately follows the request headers. This is used in the FieldToMatch specification.
Use the specifications in this object to indicate which parts of the JSON body to inspect using the rule's inspection criteria. AWS WAF inspects only the parts of the JSON that result from the matches that you indicate.
Members
- InvalidFallbackBehavior
-
- Type: string
The inspection behavior to fall back to if the JSON in the request body is invalid. For AWS WAF, invalid JSON is any content that isn't complete syntactical JSON, content whose root node isn't an object or an array, and duplicate keys in the content.
You can specify the following fallback behaviors:
-
MATCH
- Treat the web request as matching the rule statement. AWS WAF applies the rule action to the request. -
NO_MATCH
- Treat the web request as not matching the rule statement. -
EVALUATE_AS_STRING
- Inspect the body as plain text. This option applies the text transformations and inspection criteria that you defined for the JSON inspection to the body text string.
If you don't provide this setting, when AWS WAF encounters invalid JSON, it parses and inspects what it can, up to the first invalid JSON that it encounters.
- MatchPattern
-
- Required: Yes
- Type: JsonMatchPattern structure
The patterns to look for in the JSON body. AWS WAF inspects the results of these pattern matches against the rule inspection criteria.
- MatchScope
-
- Required: Yes
- Type: string
The parts of the JSON to match against using the
MatchPattern
. If you specifyAll
, AWS WAF matches against keys and values.
JsonMatchPattern
Description
The patterns to look for in the JSON body. AWS WAF inspects the results of these pattern matches against the rule inspection criteria. This is used with the FieldToMatch option JsonBody
.
Members
- All
-
- Type: All structure
Match all of the elements. See also
MatchScope
in JsonBody.You must specify either this setting or the
IncludedPaths
setting, but not both. - IncludedPaths
-
- Type: Array of strings
Match only the specified include paths. See also
MatchScope
in JsonBody.Provide the include paths using JSON Pointer syntax. For example,
"IncludedPaths": ["/dogs/0/name", "/dogs/1/name"]
. For information about this syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer.You must specify either this setting or the
All
setting, but not both.Don't use this option to include all paths. Instead, use the
All
setting.
LoggingConfiguration
Description
Defines an association between Amazon Kinesis Data Firehose destinations and a web ACL resource, for logging from AWS WAF. As part of the association, you can specify parts of the standard logging fields to keep out of the logs.
Members
- LogDestinationConfigs
-
- Required: Yes
- Type: Array of strings
The Amazon Kinesis Data Firehose Amazon Resource Name (ARNs) that you want to associate with the web ACL.
- ManagedByFirewallManager
-
- Type: boolean
Indicates whether the logging configuration was created by AWS Firewall Manager, as part of an AWS WAF policy configuration. If true, only Firewall Manager can modify or delete the configuration.
- RedactedFields
-
- Type: Array of FieldToMatch structures
The parts of the request that you want to keep out of the logs. For example, if you redact the
HEADER
field, theHEADER
field in the firehose will bexxx
.You must use one of the following values:
URI
,QUERY_STRING
,HEADER
, orMETHOD
. - ResourceArn
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the web ACL that you want to associate with
LogDestinationConfigs
.
ManagedRuleGroupStatement
Description
A rule statement used to run the rules that are defined in a managed rule group. To use this, provide the vendor name and the name of the rule group in this statement. You can retrieve the required names by calling ListAvailableManagedRuleGroups.
You can't nest a ManagedRuleGroupStatement
, for example for use inside a NotStatement
or OrStatement
. It can only be referenced as a top-level statement within a rule.
Members
- ExcludedRules
-
- Type: Array of ExcludedRule structures
The rules whose actions are set to
COUNT
by the web ACL, regardless of the action that is set on the rule. This effectively excludes the rule from acting on web requests. - Name
-
- Required: Yes
- Type: string
The name of the managed rule group. You use this, along with the vendor name, to identify the rule group.
- VendorName
-
- Required: Yes
- Type: string
The name of the managed rule group vendor. You use this, along with the rule group name, to identify the rule group.
ManagedRuleGroupSummary
Description
High-level information about a managed rule group, returned by ListAvailableManagedRuleGroups. This provides information like the name and vendor name, that you provide when you add a ManagedRuleGroupStatement to a web ACL. Managed rule groups include AWS Managed Rules rule groups, which are free of charge to AWS WAF customers, and AWS Marketplace managed rule groups, which you can subscribe to through AWS Marketplace.
Members
- Description
-
- Type: string
The description of the managed rule group, provided by AWS Managed Rules or the AWS Marketplace seller who manages it.
- Name
-
- Type: string
The name of the managed rule group. You use this, along with the vendor name, to identify the rule group.
- VendorName
-
- Type: string
The name of the managed rule group vendor. You use this, along with the rule group name, to identify the rule group.
Method
Description
The HTTP method of a web request. The method indicates the type of operation that the request is asking the origin to perform.
This is used only to indicate the web request component for AWS WAF to inspect, in the FieldToMatch specification.
Members
NoneAction
Description
Specifies that AWS WAF should do nothing. This is generally used to try out a rule without performing any actions. You set the OverrideAction
on the Rule.
This is used only in the context of other settings, for example to specify values for RuleAction and web ACL DefaultAction.
Members
NotStatement
Description
A logical rule statement used to negate the results of another rule statement. You provide one Statement within the NotStatement
.
Members
- Statement
-
- Required: Yes
- Type: Statement structure
The statement to negate. You can use any statement that can be nested.
OrStatement
Description
A logical rule statement used to combine other rule statements with OR logic. You provide more than one Statement within the OrStatement
.
Members
- Statements
-
- Required: Yes
- Type: Array of Statement structures
The statements to combine with OR logic. You can use any statements that can be nested.
OverrideAction
Description
The override action to apply to the rules in a rule group. Used only for rule statements that reference a rule group, like RuleGroupReferenceStatement
and ManagedRuleGroupStatement
.
Set the override action to none to leave the rule actions in effect. Set it to count to only count matches, regardless of the rule action settings.
In a Rule, you must specify either this OverrideAction
setting or the rule Action
setting, but not both:
-
If the rule statement references a rule group, use this override action setting and not the action setting.
-
If the rule statement does not reference a rule group, use the rule action setting and not this rule override action setting.
Members
- Count
-
- Type: CountAction structure
Override the rule action setting to count.
- None
-
- Type: NoneAction structure
Don't override the rule action setting.
QueryString
Description
The query string of a web request. This is the part of a URL that appears after a ?
character, if any.
This is used only to indicate the web request component for AWS WAF to inspect, in the FieldToMatch specification.
Members
RateBasedStatement
Description
A rate-based rule tracks the rate of requests for each originating IP address, and triggers the rule action when the rate exceeds a limit that you specify on the number of requests in any 5-minute time span. You can use this to put a temporary block on requests from an IP address that is sending excessive requests.
When the rule action triggers, AWS WAF blocks additional requests from the IP address until the request rate falls below the limit.
You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts requests that match the nested statement. For example, based on recent requests that you have seen from an attacker, you might create a rate-based rule with a nested AND rule statement that contains the following nested statements:
-
An IP match statement with an IP set that specified the address 192.0.2.44.
-
A string match statement that searches in the User-Agent header for the string BadBot.
In this rate-based rule, you also define a rate limit. For this example, the rate limit is 1,000. Requests that meet both of the conditions in the statements are counted. If the count exceeds 1,000 requests per five minutes, the rule action triggers. Requests that do not meet both conditions are not counted towards the rate limit and are not affected by this rule.
You cannot nest a RateBasedStatement
, for example for use inside a NotStatement
or OrStatement
. It can only be referenced as a top-level statement within a rule.
Members
- AggregateKeyType
-
- Required: Yes
- Type: string
Setting that indicates how to aggregate the request counts. The options are the following:
-
IP - Aggregate the request counts on the IP address from the web request origin.
-
FORWARDED_IP - Aggregate the request counts on the first IP address in an HTTP header. If you use this, configure the
ForwardedIPConfig
, to specify the header to use.
- ForwardedIPConfig
-
- Type: ForwardedIPConfig structure
The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name.
If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.
This is required if
AggregateKeyType
is set toFORWARDED_IP
. - Limit
-
- Required: Yes
- Type: long (int|float)
The limit on requests per 5-minute period for a single originating IP address. If the statement includes a
ScopeDownStatement
, this limit is applied only to the requests that match the statement. - ScopeDownStatement
-
- Type: Statement structure
An optional nested statement that narrows the scope of the rate-based statement to matching web requests. This can be any nestable statement, and you can nest statements at any level below this scope-down statement.
RateBasedStatementManagedKeysIPSet
Description
The set of IP addresses that are currently blocked for a rate-based statement.
Members
Regex
RegexPatternSet
Description
Contains one or more regular expressions.
AWS WAF assigns an ARN to each RegexPatternSet
that you create. To use a set in a rule, you provide the ARN to the Rule statement RegexPatternSetReferenceStatement.
Members
- ARN
-
- Type: string
The Amazon Resource Name (ARN) of the entity.
- Description
-
- Type: string
A description of the set that helps with identification.
- Id
-
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- Name
-
- Type: string
The name of the set. You cannot change the name after you create the set.
- RegularExpressionList
-
- Type: Array of Regex structures
The regular expression patterns in the set.
RegexPatternSetReferenceStatement
Description
A rule statement used to search web request components for matches with regular expressions. To use this, create a RegexPatternSet that specifies the expressions that you want to detect, then use the ARN of that set in this statement. A web request matches the pattern set rule statement if the request component matches any of the patterns in the set. To create a regex pattern set, see CreateRegexPatternSet.
Each regex pattern set rule statement references a regex pattern set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.
Members
- ARN
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the RegexPatternSet that this statement references.
- FieldToMatch
-
- Required: Yes
- Type: FieldToMatch structure
The part of a web request that you want AWS WAF to inspect. For more information, see FieldToMatch.
- TextTransformations
-
- Required: Yes
- Type: Array of TextTransformation structures
Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by
FieldToMatch
, starting from the lowest priority setting, before inspecting the content for a match.
RegexPatternSetSummary
Description
High-level information about a RegexPatternSet, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a RegexPatternSet
, and the ARN, that you provide to the RegexPatternSetReferenceStatement to use the pattern set in a Rule.
Members
- ARN
-
- Type: string
The Amazon Resource Name (ARN) of the entity.
- Description
-
- Type: string
A description of the set that helps with identification.
- Id
-
- Type: string
A unique identifier for the set. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- LockToken
-
- Type: 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. - Name
-
- Type: string
The name of the data type instance. You cannot change the name after you create the instance.
Rule
Description
A single rule, which you can use in a WebACL or RuleGroup to identify 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.
Members
- Action
-
- Type: RuleAction structure
The action that AWS WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.
This is used only for rules whose statements do not reference a rule group. Rule statements that reference a rule group include
RuleGroupReferenceStatement
andManagedRuleGroupStatement
.You must specify either this
Action
setting or the ruleOverrideAction
setting, but not both:-
If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.
-
If the rule statement references a rule group, use the override action setting and not this action setting.
- Name
-
- Required: Yes
- Type: string
The name of the rule. You can't change the name of a
Rule
after you create it. - OverrideAction
-
- Type: OverrideAction structure
The override action to apply to the rules in a rule group. Used only for rule statements that reference a rule group, like
RuleGroupReferenceStatement
andManagedRuleGroupStatement
.Set the override action to none to leave the rule actions in effect. Set it to count to only count matches, regardless of the rule action settings.
In a Rule, you must specify either this
OverrideAction
setting or the ruleAction
setting, but not both:-
If the rule statement references a rule group, use this override action setting and not the action setting.
-
If the rule statement does not reference a rule group, use the rule action setting and not this rule override action setting.
- Priority
-
- Required: Yes
- Type: int
If you define more than one
Rule
in aWebACL
, AWS WAF evaluates each request against theRules
in order based on the value ofPriority
. AWS WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different. - Statement
-
- Required: Yes
- Type: Statement structure
The AWS WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.
- VisibilityConfig
-
- Required: Yes
- Type: VisibilityConfig structure
Defines and enables Amazon CloudWatch metrics and web request sample collection.
RuleAction
Description
The action that AWS WAF should take on a web request when it matches a rule's statement. Settings at the web ACL level can override the rule action setting.
Members
- Allow
-
- Type: AllowAction structure
Instructs AWS WAF to allow the web request.
- Block
-
- Type: BlockAction structure
Instructs AWS WAF to block the web request.
- Count
-
- Type: CountAction structure
Instructs AWS WAF to count the web request and allow it.
RuleGroup
Description
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.
Members
- ARN
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the entity.
- Capacity
-
- Required: Yes
- Type: long (int|float)
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
-
- Type: string
A description of the rule group that helps with identification.
- Id
-
- Required: Yes
- Type: 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.
- Name
-
- Required: Yes
- Type: string
The name of the rule group. You cannot change the name of a rule group after you create it.
- Rules
-
- Type: Array of Rule structures
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.
- VisibilityConfig
-
- Required: Yes
- Type: VisibilityConfig structure
Defines and enables Amazon CloudWatch metrics and web request sample collection.
RuleGroupReferenceStatement
Description
A rule statement used to run the rules that are defined in a RuleGroup. To use this, create a rule group with your rules, then provide the ARN of the rule group in this statement.
You cannot nest a RuleGroupReferenceStatement
, for example for use inside a NotStatement
or OrStatement
. It can only be referenced as a top-level statement within a rule.
Members
- ARN
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the entity.
- ExcludedRules
-
- Type: Array of ExcludedRule structures
The names of rules that are in the referenced rule group, but that you want AWS WAF to exclude from processing for this rule statement.
RuleGroupSummary
Description
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.
Members
- ARN
-
- Type: string
The Amazon Resource Name (ARN) of the entity.
- Description
-
- Type: string
A description of the rule group that helps with identification.
- Id
-
- Type: 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.
- LockToken
-
- Type: 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. - Name
-
- Type: string
The name of the data type instance. You cannot change the name after you create the instance.
RuleSummary
Description
High-level information about a Rule, returned by operations like DescribeManagedRuleGroup. 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.
Members
- Action
-
- Type: RuleAction structure
The action that AWS WAF should take on a web request when it matches a rule's statement. Settings at the web ACL level can override the rule action setting.
- Name
-
- Type: string
The name of the rule.
SampledHTTPRequest
Description
Represents a single sampled web request. The response from GetSampledRequests includes a SampledHTTPRequests
complex type that appears as SampledRequests
in the response syntax. SampledHTTPRequests
contains an array of SampledHTTPRequest
objects.
Members
- Action
-
- Type: string
The action for the
Rule
that the request matched:ALLOW
,BLOCK
, orCOUNT
. - Request
-
- Required: Yes
- Type: HTTPRequest structure
A complex type that contains detailed information about the request.
- RuleNameWithinRuleGroup
-
- Type: string
The name of the
Rule
that the request matched. For managed rule groups, the format for this name is<vendor name>#<managed rule group name>#<rule name>
. For your own rule groups, the format for this name is<rule group name>#<rule name>
. If the rule is not in a rule group, this field is absent. - Timestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds).
- Weight
-
- Required: Yes
- Type: long (int|float)
A value that indicates how one result in the response relates proportionally to other results in the response. For example, a result that has a weight of
2
represents roughly twice as many web requests as a result that has a weight of1
.
SingleHeader
Description
One of the headers in a web request, identified by name, for example, User-Agent
or Referer
. This setting isn't case sensitive.
This is used only to indicate the web request component for AWS WAF to inspect, in the FieldToMatch specification.
Members
SingleQueryArgument
Description
One query argument in a web request, identified by name, for example UserName or SalesRegion. The name can be up to 30 characters long and isn't case sensitive.
Members
SizeConstraintStatement
Description
A rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<). For example, you can use a size constraint statement to look for query strings that are longer than 100 bytes.
If you configure AWS WAF to inspect the request body, AWS WAF inspects only the first 8192 bytes (8 KB). If the request body for your web requests never exceeds 8192 bytes, you can create a size constraint condition and block requests that have a request body greater than 8192 bytes.
If you choose URI for the value of Part of the request to filter on, the slash (/) in the URI counts as one character. For example, the URI /logo.jpg
is nine characters long.
Members
- ComparisonOperator
-
- Required: Yes
- Type: string
The operator to use to compare the request part to the size setting.
- FieldToMatch
-
- Required: Yes
- Type: FieldToMatch structure
The part of a web request that you want AWS WAF to inspect. For more information, see FieldToMatch.
- Size
-
- Required: Yes
- Type: long (int|float)
The size, in byte, to compare to the request part, after any transformations.
- TextTransformations
-
- Required: Yes
- Type: Array of TextTransformation structures
Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by
FieldToMatch
, starting from the lowest priority setting, before inspecting the content for a match.
SqliMatchStatement
Description
Attackers sometimes insert malicious SQL code into web requests in an effort to extract data from your database. To allow or block web requests that appear to contain malicious SQL code, create one or more SQL injection match conditions. An SQL injection match condition identifies the part of web requests, such as the URI or the query string, that you want AWS WAF to inspect. Later in the process, when you create a web ACL, you specify whether to allow or block requests that appear to contain malicious SQL code.
Members
- FieldToMatch
-
- Required: Yes
- Type: FieldToMatch structure
The part of a web request that you want AWS WAF to inspect. For more information, see FieldToMatch.
- TextTransformations
-
- Required: Yes
- Type: Array of TextTransformation structures
Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by
FieldToMatch
, starting from the lowest priority setting, before inspecting the content for a match.
Statement
Description
The processing guidance for a Rule, used by AWS WAF to determine whether a web request matches the rule.
Members
- AndStatement
-
- Type: AndStatement structure
A logical rule statement used to combine other rule statements with AND logic. You provide more than one Statement within the
AndStatement
. - ByteMatchStatement
-
- Type: ByteMatchStatement structure
A rule statement that defines a string match search for AWS WAF to apply to web requests. The byte match statement provides the bytes to search for, the location in requests that you want AWS WAF to search, and other settings. The bytes to search for are typically a string that corresponds with ASCII characters. In the AWS WAF console and the developer guide, this is refered to as a string match statement.
- GeoMatchStatement
-
- Type: GeoMatchStatement structure
A rule statement used to identify web requests based on country of origin.
- IPSetReferenceStatement
-
- Type: IPSetReferenceStatement structure
A rule statement used to detect web requests coming from particular IP addresses or address ranges. To use this, create an IPSet that specifies the addresses you want to detect, then use the ARN of that set in this statement. To create an IP set, see CreateIPSet.
Each IP set rule statement references an IP set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.
- ManagedRuleGroupStatement
-
- Type: ManagedRuleGroupStatement structure
A rule statement used to run the rules that are defined in a managed rule group. To use this, provide the vendor name and the name of the rule group in this statement. You can retrieve the required names by calling ListAvailableManagedRuleGroups.
You can't nest a
ManagedRuleGroupStatement
, for example for use inside aNotStatement
orOrStatement
. It can only be referenced as a top-level statement within a rule. - NotStatement
-
- Type: NotStatement structure
A logical rule statement used to negate the results of another rule statement. You provide one Statement within the
NotStatement
. - OrStatement
-
- Type: OrStatement structure
A logical rule statement used to combine other rule statements with OR logic. You provide more than one Statement within the
OrStatement
. - RateBasedStatement
-
- Type: RateBasedStatement structure
A rate-based rule tracks the rate of requests for each originating IP address, and triggers the rule action when the rate exceeds a limit that you specify on the number of requests in any 5-minute time span. You can use this to put a temporary block on requests from an IP address that is sending excessive requests.
When the rule action triggers, AWS WAF blocks additional requests from the IP address until the request rate falls below the limit.
You can optionally nest another statement inside the rate-based statement, to narrow the scope of the rule so that it only counts requests that match the nested statement. For example, based on recent requests that you have seen from an attacker, you might create a rate-based rule with a nested AND rule statement that contains the following nested statements:
-
An IP match statement with an IP set that specified the address 192.0.2.44.
-
A string match statement that searches in the User-Agent header for the string BadBot.
In this rate-based rule, you also define a rate limit. For this example, the rate limit is 1,000. Requests that meet both of the conditions in the statements are counted. If the count exceeds 1,000 requests per five minutes, the rule action triggers. Requests that do not meet both conditions are not counted towards the rate limit and are not affected by this rule.
You cannot nest a
RateBasedStatement
, for example for use inside aNotStatement
orOrStatement
. It can only be referenced as a top-level statement within a rule. - RegexPatternSetReferenceStatement
-
- Type: RegexPatternSetReferenceStatement structure
A rule statement used to search web request components for matches with regular expressions. To use this, create a RegexPatternSet that specifies the expressions that you want to detect, then use the ARN of that set in this statement. A web request matches the pattern set rule statement if the request component matches any of the patterns in the set. To create a regex pattern set, see CreateRegexPatternSet.
Each regex pattern set rule statement references a regex pattern set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.
- RuleGroupReferenceStatement
-
- Type: RuleGroupReferenceStatement structure
A rule statement used to run the rules that are defined in a RuleGroup. To use this, create a rule group with your rules, then provide the ARN of the rule group in this statement.
You cannot nest a
RuleGroupReferenceStatement
, for example for use inside aNotStatement
orOrStatement
. It can only be referenced as a top-level statement within a rule. - SizeConstraintStatement
-
- Type: SizeConstraintStatement structure
A rule statement that compares a number of bytes against the size of a request component, using a comparison operator, such as greater than (>) or less than (<). For example, you can use a size constraint statement to look for query strings that are longer than 100 bytes.
If you configure AWS WAF to inspect the request body, AWS WAF inspects only the first 8192 bytes (8 KB). If the request body for your web requests never exceeds 8192 bytes, you can create a size constraint condition and block requests that have a request body greater than 8192 bytes.
If you choose URI for the value of Part of the request to filter on, the slash (/) in the URI counts as one character. For example, the URI
/logo.jpg
is nine characters long. - SqliMatchStatement
-
- Type: SqliMatchStatement structure
Attackers sometimes insert malicious SQL code into web requests in an effort to extract data from your database. To allow or block web requests that appear to contain malicious SQL code, create one or more SQL injection match conditions. An SQL injection match condition identifies the part of web requests, such as the URI or the query string, that you want AWS WAF to inspect. Later in the process, when you create a web ACL, you specify whether to allow or block requests that appear to contain malicious SQL code.
- XssMatchStatement
-
- Type: XssMatchStatement structure
A rule statement that defines a cross-site scripting (XSS) match search for AWS WAF to apply to web requests. XSS attacks are those where the attacker uses vulnerabilities in a benign website as a vehicle to inject malicious client-site scripts into other legitimate web browsers. The XSS match statement provides the location in requests that you want AWS WAF to search and text transformations to use on the search area before AWS WAF searches for character sequences that are likely to be malicious strings.
Tag
Description
A tag associated with an AWS resource. Tags are key:value pairs that you can use to categorize and manage your resources, for purposes like billing or other management. Typically, the tag key represents a category, such as "environment", and the tag value represents a specific value within that category, such as "test," "development," or "production". Or you might set the tag key to "customer" and the value to the customer name or ID. You can specify one or more tags to add to each AWS resource, up to 50 tags for a resource.
You can tag the AWS resources that you manage through AWS WAF: web ACLs, rule groups, IP sets, and regex pattern sets. You can't manage or view tags through the AWS WAF console.
Members
- Key
-
- Required: Yes
- Type: string
Part of the key:value pair that defines a tag. You can use a tag key to describe a category of information, such as "customer." Tag keys are case-sensitive.
- Value
-
- Required: Yes
- Type: string
Part of the key:value pair that defines a tag. You can use a tag value to describe a specific value within a category, such as "companyA" or "companyB." Tag values are case-sensitive.
TagInfoForResource
Description
The collection of tagging definitions for an AWS resource. Tags are key:value pairs that you can use to categorize and manage your resources, for purposes like billing or other management. Typically, the tag key represents a category, such as "environment", and the tag value represents a specific value within that category, such as "test," "development," or "production". Or you might set the tag key to "customer" and the value to the customer name or ID. You can specify one or more tags to add to each AWS resource, up to 50 tags for a resource.
You can tag the AWS resources that you manage through AWS WAF: web ACLs, rule groups, IP sets, and regex pattern sets. You can't manage or view tags through the AWS WAF console.
Members
TextTransformation
Description
Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.
Members
- Priority
-
- Required: Yes
- Type: int
Sets the relative processing order for multiple transformations that are defined for a rule statement. AWS WAF processes all transformations, from lowest priority to highest, before inspecting the transformed content. The priorities don't need to be consecutive, but they must all be different.
- Type
-
- Required: Yes
- Type: string
You can specify the following transformation types:
CMD_LINE
When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:
-
Delete the following characters: \ " ' ^
-
Delete spaces before the following characters: / (
-
Replace the following characters with a space: , ;
-
Replace multiple spaces with one space
-
Convert uppercase letters (A-Z) to lowercase (a-z)
COMPRESS_WHITE_SPACE
Use this option to replace the following characters with a space character (decimal 32):
-
\f, formfeed, decimal 12
-
\t, tab, decimal 9
-
\n, newline, decimal 10
-
\r, carriage return, decimal 13
-
\v, vertical tab, decimal 11
-
non-breaking space, decimal 160
COMPRESS_WHITE_SPACE
also replaces multiple spaces with one space.HTML_ENTITY_DECODE
Use this option to replace HTML-encoded characters with unencoded characters.
HTML_ENTITY_DECODE
performs the following operations:-
Replaces
(ampersand)quot;
with"
-
Replaces
(ampersand)nbsp;
with a non-breaking space, decimal 160 -
Replaces
(ampersand)lt;
with a "less than" symbol -
Replaces
(ampersand)gt;
with>
-
Replaces characters that are represented in hexadecimal format,
(ampersand)#xhhhh;
, with the corresponding characters -
Replaces characters that are represented in decimal format,
(ampersand)#nnnn;
, with the corresponding characters
LOWERCASE
Use this option to convert uppercase letters (A-Z) to lowercase (a-z).
URL_DECODE
Use this option to decode a URL-encoded value.
NONE
Specify
NONE
if you don't want any text transformations.
TimeWindow
Description
In a GetSampledRequests request, the StartTime
and EndTime
objects specify the time range for which you want AWS WAF to return a sample of web requests.
You must specify the times in Coordinated Universal Time (UTC) format. UTC format includes the special designator, Z
. For example, "2016-09-27T14:50Z"
. You can specify any time range in the previous three hours.
In a GetSampledRequests response, the StartTime
and EndTime
objects specify the time range for which AWS WAF actually returned a sample of web requests. AWS WAF gets the specified number of requests from among the first 5,000 requests that your AWS resource receives during the specified time period. If your resource receives more than 5,000 requests during that period, AWS WAF stops sampling after the 5,000th request. In that case, EndTime
is the time that AWS WAF received the 5,000th request.
Members
- EndTime
-
- Required: Yes
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The end of the time range from which you want
GetSampledRequests
to return a sample of the requests that your AWS resource received. You must specify the times in Coordinated Universal Time (UTC) format. UTC format includes the special designator,Z
. For example,"2016-09-27T14:50Z"
. You can specify any time range in the previous three hours. - StartTime
-
- Required: Yes
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The beginning of the time range from which you want
GetSampledRequests
to return a sample of the requests that your AWS resource received. You must specify the times in Coordinated Universal Time (UTC) format. UTC format includes the special designator,Z
. For example,"2016-09-27T14:50Z"
. You can specify any time range in the previous three hours.
UriPath
Description
The path component of the URI of a web request. This is the part of a web request that identifies a resource, for example, /images/daily-ad.jpg
.
This is used only to indicate the web request component for AWS WAF to inspect, in the FieldToMatch specification.
Members
VisibilityConfig
Description
Defines and enables Amazon CloudWatch metrics and web request sample collection.
Members
- CloudWatchMetricsEnabled
-
- Required: Yes
- Type: boolean
A boolean indicating whether the associated resource sends metrics to CloudWatch. For the list of available metrics, see AWS WAF Metrics.
- MetricName
-
- Required: Yes
- Type: string
A name of the CloudWatch metric. The name can contain only the characters: A-Z, a-z, 0-9, - (hyphen), and _ (underscore). The name can be from one to 128 characters long. It can't contain whitespace or metric names reserved for AWS WAF, for example "All" and "Default_Action."
- SampledRequestsEnabled
-
- Required: Yes
- Type: boolean
A boolean indicating whether AWS WAF should store a sampling of the web requests that match the rules. You can view the sampled requests through the AWS WAF console.
WAFAssociatedItemException
Description
AWS WAF couldn’t perform the operation because your resource is being used by another resource or it’s associated with another resource.
Members
WAFDuplicateItemException
Description
AWS WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
Members
WAFInternalErrorException
Description
Your request is valid, but AWS WAF couldn’t perform the operation because of a system problem. Retry your request.
Members
WAFInvalidOperationException
WAFInvalidParameterException
Description
The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name or value.
-
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 aDefaultAction
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 cannot be associated.
Members
WAFInvalidPermissionPolicyException
Description
The operation failed because the specified policy isn't in the proper format.
The policy specifications must conform to the following:
-
The policy must be composed using IAM Policy version 2012-10-17 or version 2015-01-01.
-
The policy must include specifications for
Effect
,Action
, andPrincipal
. -
Effect
must specifyAllow
. -
Action
must specifywafv2:CreateWebACL
,wafv2:UpdateWebACL
, andwafv2:PutFirewallManagerRuleGroups
. AWS WAF rejects any extra actions or wildcard actions in the policy. -
The policy must not include a
Resource
parameter.
For more information, see IAM Policies.
Members
WAFInvalidResourceException
Description
AWS WAF couldn’t perform the operation because the resource that you requested isn’t valid. Check the resource, and try again.
Members
WAFLimitsExceededException
Description
AWS 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 AWS account. For more information, see Limits in the AWS WAF Developer Guide.
Members
WAFNonexistentItemException
Description
AWS WAF couldn’t perform the operation because your resource doesn’t exist.
Members
WAFOptimisticLockException
Description
AWS WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
Members
WAFServiceLinkedRoleErrorException
Description
AWS WAF is not able to access the service linked role. This can be caused by a previous PutLoggingConfiguration
request, which can lock the service linked role for about 20 seconds. Please try your request again. The service linked role can also be locked by a previous DeleteServiceLinkedRole
request, which can lock the role for 15 minutes or more. If you recently made a call to DeleteServiceLinkedRole
, wait at least 15 minutes and try the request again. If you receive this same exception again, you will have to wait additional time until the role is unlocked.
Members
WAFSubscriptionNotFoundException
WAFTagOperationException
Description
An error occurred during the tagging operation. Retry your request.
Members
WAFTagOperationInternalErrorException
Description
AWS WAF couldn’t perform your tagging operation because of an internal error. Retry your request.
Members
WAFUnavailableEntityException
Description
AWS WAF couldn’t retrieve the resource that you requested. Retry your request.
Members
WebACL
Description
A Web ACL defines a collection of rules to use to inspect and control web requests. Each rule has an action defined (allow, block, or count) for requests that match the statement of the rule. In the Web ACL, you assign a default action to take (allow, block) for any request that does not match any of the rules. The rules in a Web ACL can be a combination of the types Rule, RuleGroup, and managed rule group. You can associate a Web ACL with one or more AWS resources to protect. The resources can be Amazon CloudFront, an Amazon API Gateway REST API, an Application Load Balancer, or an AWS AppSync GraphQL API.
Members
- ARN
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
- Capacity
-
- Type: long (int|float)
The web ACL capacity units (WCUs) currently being used by this web ACL.
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.
- DefaultAction
-
- Required: Yes
- Type: DefaultAction structure
The action to perform if none of the
Rules
contained in theWebACL
match. - Description
-
- Type: string
A description of the Web ACL that helps with identification.
- Id
-
- Required: Yes
- Type: string
A unique identifier for the
WebACL
. This ID is returned in the responses to create and list commands. You use this ID to do things like get, update, and delete aWebACL
. - ManagedByFirewallManager
-
- Type: boolean
Indicates whether this web ACL is managed by AWS Firewall Manager. If true, then only AWS Firewall Manager can delete the web ACL or any Firewall Manager rule groups in the web ACL.
- Name
-
- Required: Yes
- Type: string
The name of the Web ACL. You cannot change the name of a Web ACL after you create it.
- PostProcessFirewallManagerRuleGroups
-
- Type: Array of FirewallManagerRuleGroup structures
The last set of rules for AWS WAF to process in the web ACL. This is defined in an AWS Firewall Manager WAF policy and contains only rule group references. You can't alter these. Any rules and rule groups that you define for the web ACL are prioritized before these.
In the Firewall Manager WAF policy, the Firewall Manager administrator can define a set of rule groups to run first in the web ACL and a set of rule groups to run last. Within each set, the administrator prioritizes the rule groups, to determine their relative processing order.
- PreProcessFirewallManagerRuleGroups
-
- Type: Array of FirewallManagerRuleGroup structures
The first set of rules for AWS WAF to process in the web ACL. This is defined in an AWS Firewall Manager WAF policy and contains only rule group references. You can't alter these. Any rules and rule groups that you define for the web ACL are prioritized after these.
In the Firewall Manager WAF policy, the Firewall Manager administrator can define a set of rule groups to run first in the web ACL and a set of rule groups to run last. Within each set, the administrator prioritizes the rule groups, to determine their relative processing order.
- Rules
-
- Type: Array of Rule structures
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.
- VisibilityConfig
-
- Required: Yes
- Type: VisibilityConfig structure
Defines and enables Amazon CloudWatch metrics and web request sample collection.
WebACLSummary
Description
High-level information about a WebACL, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a WebACL
, and the ARN, that you provide to operations like AssociateWebACL.
Members
- ARN
-
- Type: string
The Amazon Resource Name (ARN) of the entity.
- Description
-
- Type: string
A description of the Web ACL that helps with identification.
- Id
-
- Type: string
The unique identifier for the Web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.
- LockToken
-
- Type: 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. - Name
-
- Type: string
The name of the Web ACL. You cannot change the name of a Web ACL after you create it.
XssMatchStatement
Description
A rule statement that defines a cross-site scripting (XSS) match search for AWS WAF to apply to web requests. XSS attacks are those where the attacker uses vulnerabilities in a benign website as a vehicle to inject malicious client-site scripts into other legitimate web browsers. The XSS match statement provides the location in requests that you want AWS WAF to search and text transformations to use on the search area before AWS WAF searches for character sequences that are likely to be malicious strings.
Members
- FieldToMatch
-
- Required: Yes
- Type: FieldToMatch structure
The part of a web request that you want AWS WAF to inspect. For more information, see FieldToMatch.
- TextTransformations
-
- Required: Yes
- Type: Array of TextTransformation structures
Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by
FieldToMatch
, starting from the lowest priority setting, before inspecting the content for a match.