Copyright | (c) 2013-2018 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 |
Language | Haskell2010 |
Inserts or deletes ActivatedRule
objects in a WebACL
. Each Rule
identifies web requests that you want to allow, block, or count. When you update a WebACL
, you specify the following values:
- A default action for the
WebACL
, eitherALLOW
orBLOCK
. AWS WAF performs the default action if a request doesn't match the criteria in any of theRules
in aWebACL
. - The
Rules
that you want to add and/or delete. If you want to replace oneRule
with another, you delete the existingRule
and add the new one. - For each
Rule
, whether you want AWS WAF to allow requests, block requests, or count requests that match the conditions in theRule
. - The order in which you want AWS WAF to evaluate the
Rules
in aWebACL
. If you add more than oneRule
to aWebACL
, AWS WAF evaluates each request against theRules
in order based on the value ofPriority
. (TheRule
that has the lowest value forPriority
is evaluated first.) When a web request matches all of the predicates (such asByteMatchSets
andIPSets
) in aRule
, AWS WAF immediately takes the corresponding action, allow or block, and doesn't evaluate the request against the remainingRules
in theWebACL
, if any.
To create and configure a WebACL
, perform the following steps:
- Create and update the predicates that you want to include in
Rules
. For more information, seeCreateByteMatchSet
,UpdateByteMatchSet
,CreateIPSet
,UpdateIPSet
,CreateSqlInjectionMatchSet
, andUpdateSqlInjectionMatchSet
. - Create and update the
Rules
that you want to include in theWebACL
. For more information, seeCreateRule
andUpdateRule
. - Create a
WebACL
. SeeCreateWebACL
. - Use
GetChangeToken
to get the change token that you provide in theChangeToken
parameter of anUpdateWebACL
request. - Submit an
UpdateWebACL
request to specify theRules
that you want to include in theWebACL
, to specify the default action, and to associate theWebACL
with a CloudFront distribution.
Be aware that if you try to add a RATE_BASED rule to a web ACL without setting the rule type when first creating the rule, the UpdateWebACL
request will fail because the request tries to add a REGULAR rule (the default rule type) with the specified ID, which does not exist.
For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .
- updateWebACL :: Text -> Text -> UpdateWebACL
- data UpdateWebACL
- uwaUpdates :: Lens' UpdateWebACL [WebACLUpdate]
- uwaDefaultAction :: Lens' UpdateWebACL (Maybe WafAction)
- uwaWebACLId :: Lens' UpdateWebACL Text
- uwaChangeToken :: Lens' UpdateWebACL Text
- updateWebACLResponse :: Int -> UpdateWebACLResponse
- data UpdateWebACLResponse
- uwarsChangeToken :: Lens' UpdateWebACLResponse (Maybe Text)
- uwarsResponseStatus :: Lens' UpdateWebACLResponse Int
Creating a Request
Creates a value of UpdateWebACL
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
uwaUpdates
- An array of updates to make to theWebACL
. An array ofWebACLUpdate
objects that you want to insert into or delete from aWebACL
. For more information, see the applicable data types: *WebACLUpdate
: ContainsAction
andActivatedRule
*ActivatedRule
: ContainsAction
,OverrideAction
,Priority
,RuleId
, andType
.ActivatedRule|OverrideAction
applies only when updating or adding aRuleGroup
to aWebACL
. In this case you do not useActivatedRule|Action
. For all other update requests,ActivatedRule|Action
is used instead ofActivatedRule|OverrideAction
. *WafAction
: ContainsType
uwaDefaultAction
- A default action for the web ACL, either ALLOW or BLOCK. AWS WAF performs the default action if a request doesn't match the criteria in any of the rules in a web ACL.uwaWebACLId
- TheWebACLId
of theWebACL
that you want to update.WebACLId
is returned byCreateWebACL
and byListWebACLs
.uwaChangeToken
- The value returned by the most recent call toGetChangeToken
.
data UpdateWebACL Source #
See: updateWebACL
smart constructor.
Request Lenses
uwaUpdates :: Lens' UpdateWebACL [WebACLUpdate] Source #
An array of updates to make to the WebACL
. An array of WebACLUpdate
objects that you want to insert into or delete from a WebACL
. For more information, see the applicable data types: * WebACLUpdate
: Contains Action
and ActivatedRule
* ActivatedRule
: Contains Action
, OverrideAction
, Priority
, RuleId
, and Type
. ActivatedRule|OverrideAction
applies only when updating or adding a RuleGroup
to a WebACL
. In this case you do not use ActivatedRule|Action
. For all other update requests, ActivatedRule|Action
is used instead of ActivatedRule|OverrideAction
. * WafAction
: Contains Type
uwaDefaultAction :: Lens' UpdateWebACL (Maybe WafAction) Source #
A default action for the web ACL, either ALLOW or BLOCK. AWS WAF performs the default action if a request doesn't match the criteria in any of the rules in a web ACL.
uwaWebACLId :: Lens' UpdateWebACL Text Source #
The WebACLId
of the WebACL
that you want to update. WebACLId
is returned by CreateWebACL
and by ListWebACLs
.
uwaChangeToken :: Lens' UpdateWebACL Text Source #
The value returned by the most recent call to GetChangeToken
.
Destructuring the Response
Creates a value of UpdateWebACLResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
uwarsChangeToken
- TheChangeToken
that you used to submit theUpdateWebACL
request. You can also use this value to query the status of the request. For more information, seeGetChangeTokenStatus
.uwarsResponseStatus
- -- | The response status code.
data UpdateWebACLResponse Source #
See: updateWebACLResponse
smart constructor.
Response Lenses
uwarsChangeToken :: Lens' UpdateWebACLResponse (Maybe Text) Source #
The ChangeToken
that you used to submit the UpdateWebACL
request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus
.
uwarsResponseStatus :: Lens' UpdateWebACLResponse Int Source #
- - | The response status code.