| 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 |
Network.AWS.WAF.UpdateWebACL
Description
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, eitherALLOWorBLOCK. AWS WAF performs the default action if a request doesn't match the criteria in any of theRulesin aWebACL. - The
Rulesthat you want to add and/or delete. If you want to replace oneRulewith another, you delete the existingRuleand 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
Rulesin aWebACL. If you add more than oneRuleto aWebACL, AWS WAF evaluates each request against theRulesin order based on the value ofPriority. (TheRulethat has the lowest value forPriorityis evaluated first.) When a web request matches all of the predicates (such asByteMatchSetsandIPSets) in aRule, AWS WAF immediately takes the corresponding action, allow or block, and doesn't evaluate the request against the remainingRulesin 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
Rulesthat you want to include in theWebACL. For more information, seeCreateRuleandUpdateRule. - Create a
WebACL. SeeCreateWebACL. - Use
GetChangeTokento get the change token that you provide in theChangeTokenparameter of anUpdateWebACLrequest. - Submit an
UpdateWebACLrequest to specify theRulesthat you want to include in theWebACL, to specify the default action, and to associate theWebACLwith 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 .
Synopsis
- 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
Arguments
| :: Text | |
| -> Text | |
| -> UpdateWebACL |
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 ofWebACLUpdateobjects that you want to insert into or delete from aWebACL. For more information, see the applicable data types: *WebACLUpdate: ContainsActionandActivatedRule*ActivatedRule: ContainsAction,OverrideAction,Priority,RuleId, andType.ActivatedRule|OverrideActionapplies only when updating or adding aRuleGroupto aWebACL. In this case you do not useActivatedRule|Action. For all other update requests,ActivatedRule|Actionis used instead ofActivatedRule|OverrideAction. *WafAction: ContainsTypeuwaDefaultAction- 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- TheWebACLIdof theWebACLthat you want to update.WebACLIdis returned byCreateWebACLand byListWebACLs.uwaChangeToken- The value returned by the most recent call toGetChangeToken.
data UpdateWebACL Source #
See: updateWebACL smart constructor.
Instances
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
Arguments
| :: Int | |
| -> UpdateWebACLResponse |
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- TheChangeTokenthat you used to submit theUpdateWebACLrequest. 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.
Instances
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.