DeleteRuleGroup
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 RuleGroup. You can't delete a RuleGroup
if it's still used in any WebACL
objects or if it still includes any rules.
If you just want to remove a RuleGroup
from a WebACL
, use UpdateWebACL.
To permanently delete a RuleGroup
from AWS WAF, perform the following steps:
-
Update the
RuleGroup
to remove rules, if any. For more information, see UpdateRuleGroup. -
Use GetChangeToken to get the change token that you provide in the
ChangeToken
parameter of aDeleteRuleGroup
request. -
Submit a
DeleteRuleGroup
request.
Request Syntax
{
"ChangeToken": "string
",
"RuleGroupId": "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
- RuleGroupId
-
The
RuleGroupId
of the RuleGroup that you want to delete.RuleGroupId
is returned by CreateRuleGroup and by ListRuleGroups.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 theDeleteRuleGroup
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
- WAFInvalidOperationException
-
The operation failed because there was nothing to do. For example:
-
You tried to remove a
Rule
from aWebACL
, but theRule
isn't in the specifiedWebACL
. -
You tried to remove an IP address from an
IPSet
, but the IP address isn't in the specifiedIPSet
. -
You tried to remove a
ByteMatchTuple
from aByteMatchSet
, but theByteMatchTuple
isn't in the specifiedWebACL
. -
You tried to add a
Rule
to aWebACL
, but theRule
already exists in the specifiedWebACL
. -
You tried to add a
ByteMatchTuple
to aByteMatchSet
, but theByteMatchTuple
already exists in the specifiedWebACL
.
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: