DeleteByteMatchSet
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 ByteMatchSet. You can't delete a ByteMatchSet
if it's still used in any Rules
or if it still includes any ByteMatchTuple objects (any filters).
If you just want to remove a ByteMatchSet
from a Rule
, use UpdateRule.
To permanently delete a ByteMatchSet
, perform the following steps:
-
Update the
ByteMatchSet
to remove filters, if any. For more information, see UpdateByteMatchSet. -
Use GetChangeToken to get the change token that you provide in the
ChangeToken
parameter of aDeleteByteMatchSet
request. -
Submit a
DeleteByteMatchSet
request.
Request Syntax
{
"ByteMatchSetId": "string
",
"ChangeToken": "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.
- ByteMatchSetId
-
The
ByteMatchSetId
of the ByteMatchSet that you want to delete.ByteMatchSetId
is returned by CreateByteMatchSet and by ListByteMatchSets.Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
.*\S.*
Required: Yes
- 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
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 theDeleteByteMatchSet
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
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: