Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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.
Creates a Rule
, which contains the IPSet
objects, ByteMatchSet
objects, and other predicates that identify the requests that you want
to block. If you add more than one predicate to a Rule
, a request must
match all of the specifications to be allowed or blocked. For example,
suppose that you add the following to a Rule
:
- An
IPSet
that matches the IP address192.0.2.44/32
- A
ByteMatchSet
that matchesBadBot
in theUser-Agent
header
You then add the Rule
to a WebACL
and specify that you want to
blocks requests that satisfy the Rule
. For a request to be blocked, it
must come from the IP address 192.0.2.44 and the User-Agent
header
in the request must contain the value BadBot
.
To create and configure a Rule
, perform the following steps:
- Create and update the predicates that you want to include in the
Rule
. For more information, see CreateByteMatchSet, CreateIPSet, and CreateSqlInjectionMatchSet. - Use GetChangeToken to get the change token that you provide in the
ChangeToken
parameter of aCreateRule
request. - Submit a
CreateRule
request. - Use
GetChangeToken
to get the change token that you provide in theChangeToken
parameter of an UpdateRule request. - Submit an
UpdateRule
request to specify the predicates that you want to include in theRule
. - Create and update a
WebACL
that contains theRule
. For more information, see CreateWebACL.
For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide.
Synopsis
- data CreateRule = CreateRule' {
- tags :: Maybe (NonEmpty Tag)
- name :: Text
- metricName :: Text
- changeToken :: Text
- newCreateRule :: Text -> Text -> Text -> CreateRule
- createRule_tags :: Lens' CreateRule (Maybe (NonEmpty Tag))
- createRule_name :: Lens' CreateRule Text
- createRule_metricName :: Lens' CreateRule Text
- createRule_changeToken :: Lens' CreateRule Text
- data CreateRuleResponse = CreateRuleResponse' {
- rule :: Maybe Rule
- changeToken :: Maybe Text
- httpStatus :: Int
- newCreateRuleResponse :: Int -> CreateRuleResponse
- createRuleResponse_rule :: Lens' CreateRuleResponse (Maybe Rule)
- createRuleResponse_changeToken :: Lens' CreateRuleResponse (Maybe Text)
- createRuleResponse_httpStatus :: Lens' CreateRuleResponse Int
Creating a Request
data CreateRule Source #
See: newCreateRule
smart constructor.
CreateRule' | |
|
Instances
:: Text | |
-> Text | |
-> Text | |
-> CreateRule |
Create a value of CreateRule
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:tags:CreateRule'
, createRule_tags
-
$sel:name:CreateRule'
, createRule_name
- A friendly name or description of the Rule. You can't change the name
of a Rule
after you create it.
$sel:metricName:CreateRule'
, createRule_metricName
- A friendly name or description for the metrics for this Rule
. The name
can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum
length 128 and minimum length one. It can't contain whitespace or
metric names reserved for AWS WAF, including "All" and
"Default_Action." You can't change the name of the metric after you
create the Rule
.
$sel:changeToken:CreateRule'
, createRule_changeToken
- The value returned by the most recent call to GetChangeToken.
Request Lenses
createRule_tags :: Lens' CreateRule (Maybe (NonEmpty Tag)) Source #
createRule_name :: Lens' CreateRule Text Source #
A friendly name or description of the Rule. You can't change the name
of a Rule
after you create it.
createRule_metricName :: Lens' CreateRule Text Source #
A friendly name or description for the metrics for this Rule
. The name
can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum
length 128 and minimum length one. It can't contain whitespace or
metric names reserved for AWS WAF, including "All" and
"Default_Action." You can't change the name of the metric after you
create the Rule
.
createRule_changeToken :: Lens' CreateRule Text Source #
The value returned by the most recent call to GetChangeToken.
Destructuring the Response
data CreateRuleResponse Source #
See: newCreateRuleResponse
smart constructor.
CreateRuleResponse' | |
|
Instances
newCreateRuleResponse Source #
Create a value of CreateRuleResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:rule:CreateRuleResponse'
, createRuleResponse_rule
- The Rule returned in the CreateRule
response.
$sel:changeToken:CreateRule'
, createRuleResponse_changeToken
- The ChangeToken
that you used to submit the CreateRule
request. You
can also use this value to query the status of the request. For more
information, see GetChangeTokenStatus.
$sel:httpStatus:CreateRuleResponse'
, createRuleResponse_httpStatus
- The response's http status code.
Response Lenses
createRuleResponse_rule :: Lens' CreateRuleResponse (Maybe Rule) Source #
The Rule returned in the CreateRule
response.
createRuleResponse_changeToken :: Lens' CreateRuleResponse (Maybe Text) Source #
The ChangeToken
that you used to submit the CreateRule
request. You
can also use this value to query the status of the request. For more
information, see GetChangeTokenStatus.
createRuleResponse_httpStatus :: Lens' CreateRuleResponse Int Source #
The response's http status code.