DeleteRateBasedRule
Note
AWS WAF Classic support will end on September 30, 2025.
This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.
For the latest version of AWS WAF , use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.
Permanently deletes a RateBasedRule. You can't delete a rule if
it's still used in any WebACL
objects or if it still includes any predicates,
such as ByteMatchSet
objects.
If you just want to remove a rule from a WebACL
, use UpdateWebACL.
To permanently delete a RateBasedRule
from AWS WAF, perform the following
steps:
-
Update the
RateBasedRule
to remove predicates, if any. For more information, see UpdateRateBasedRule. -
Use GetChangeToken to get the change token that you provide in the
ChangeToken
parameter of aDeleteRateBasedRule
request. -
Submit a
DeleteRateBasedRule
request.
Request Syntax
{
"ChangeToken": "string
",
"RuleId": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ChangeToken
-
The value returned by the most recent call to GetChangeToken.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
.*\S.*
Required: Yes
- RuleId
-
The
RuleId
of the RateBasedRule that you want to delete.RuleId
is returned by CreateRateBasedRule and by ListRateBasedRules.Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
.*\S.*
Required: Yes
Response Syntax
{
"ChangeToken": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- ChangeToken
-
The
ChangeToken
that you used to submit theDeleteRateBasedRule
request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus.Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
.*\S.*
Errors
For information about the errors that are common to all actions, see Common Errors.
- WAFInternalErrorException
-
The operation failed because of a system problem, even though the request was valid. Retry your request.
HTTP Status Code: 500
- WAFInvalidAccountException
-
The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.
HTTP Status Code: 400
- WAFNonEmptyEntityException
-
The operation failed because you tried to delete an object that isn't empty. For example:
-
You tried to delete a
WebACL
that still contains one or moreRule
objects. -
You tried to delete a
Rule
that still contains one or moreByteMatchSet
objects or other predicates. -
You tried to delete a
ByteMatchSet
that contains one or moreByteMatchTuple
objects. -
You tried to delete an
IPSet
that references one or more IP addresses.
HTTP Status Code: 400
-
- WAFNonexistentItemException
-
The operation failed because the referenced object doesn't exist.
HTTP Status Code: 400
- WAFReferencedItemException
-
The operation failed because you tried to delete an object that is still in use. For example:
-
You tried to delete a
ByteMatchSet
that is still referenced by aRule
. -
You tried to delete a
Rule
that is still referenced by aWebACL
.
HTTP Status Code: 400
-
- WAFStaleDataException
-
The operation failed because you tried to create, update, or delete an object by using a change token that has already been used.
HTTP Status Code: 400
- WAFTagOperationException
-
HTTP Status Code: 400
- WAFTagOperationInternalErrorException
-
HTTP Status Code: 500
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: