amazonka-waf-regional-2.0: Amazon WAF Regional SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.WAFRegional.UpdateRateBasedRule

Description

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.

Inserts or deletes Predicate objects in a rule and updates the RateLimit in the rule.

Each Predicate object identifies a predicate, such as a ByteMatchSet or an IPSet, that specifies the web requests that you want to block or count. The RateLimit specifies the number of requests every five minutes that triggers the rule.

If you add more than one predicate to a RateBasedRule, a request must match all the predicates and exceed the RateLimit to be counted or blocked. For example, suppose you add the following to a RateBasedRule:

  • An IPSet that matches the IP address 192.0.2.44/32
  • A ByteMatchSet that matches BadBot in the User-Agent header

Further, you specify a RateLimit of 1,000.

You then add the RateBasedRule to a WebACL and specify that you want to block 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. Further, requests that match these two conditions much be received at a rate of more than 1,000 every five minutes. If the rate drops below this limit, AWS WAF no longer blocks the requests.

As a second example, suppose you want to limit requests to a particular page on your site. To do this, you could add the following to a RateBasedRule:

  • A ByteMatchSet with FieldToMatch of URI
  • A PositionalConstraint of STARTS_WITH
  • A TargetString of login

Further, you specify a RateLimit of 1,000.

By adding this RateBasedRule to a WebACL, you could limit requests to your login page without affecting the rest of your site.

Synopsis

Creating a Request

data UpdateRateBasedRule Source #

See: newUpdateRateBasedRule smart constructor.

Constructors

UpdateRateBasedRule' 

Fields

  • ruleId :: Text

    The RuleId of the RateBasedRule that you want to update. RuleId is returned by CreateRateBasedRule and by ListRateBasedRules.

  • changeToken :: Text

    The value returned by the most recent call to GetChangeToken.

  • updates :: [RuleUpdate]

    An array of RuleUpdate objects that you want to insert into or delete from a RateBasedRule.

  • rateLimit :: Natural

    The maximum number of requests, which have an identical value in the field specified by the RateKey, allowed in a five-minute period. If the number of requests exceeds the RateLimit and the other predicates specified in the rule are also met, AWS WAF triggers the action that is specified for this rule.

Instances

Instances details
ToJSON UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

ToHeaders UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

ToPath UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

ToQuery UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

AWSRequest UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

Associated Types

type AWSResponse UpdateRateBasedRule #

Generic UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

Associated Types

type Rep UpdateRateBasedRule :: Type -> Type #

Read UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

Show UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

NFData UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

Methods

rnf :: UpdateRateBasedRule -> () #

Eq UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

Hashable UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

type AWSResponse UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

type Rep UpdateRateBasedRule Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

type Rep UpdateRateBasedRule = D1 ('MetaData "UpdateRateBasedRule" "Amazonka.WAFRegional.UpdateRateBasedRule" "amazonka-waf-regional-2.0-83dY3vKOuQzAAW7M6EmzRI" 'False) (C1 ('MetaCons "UpdateRateBasedRule'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ruleId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "changeToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "updates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [RuleUpdate]) :*: S1 ('MetaSel ('Just "rateLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural))))

newUpdateRateBasedRule Source #

Create a value of UpdateRateBasedRule 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:

UpdateRateBasedRule, updateRateBasedRule_ruleId - The RuleId of the RateBasedRule that you want to update. RuleId is returned by CreateRateBasedRule and by ListRateBasedRules.

UpdateRateBasedRule, updateRateBasedRule_changeToken - The value returned by the most recent call to GetChangeToken.

$sel:updates:UpdateRateBasedRule', updateRateBasedRule_updates - An array of RuleUpdate objects that you want to insert into or delete from a RateBasedRule.

UpdateRateBasedRule, updateRateBasedRule_rateLimit - The maximum number of requests, which have an identical value in the field specified by the RateKey, allowed in a five-minute period. If the number of requests exceeds the RateLimit and the other predicates specified in the rule are also met, AWS WAF triggers the action that is specified for this rule.

Request Lenses

updateRateBasedRule_ruleId :: Lens' UpdateRateBasedRule Text Source #

The RuleId of the RateBasedRule that you want to update. RuleId is returned by CreateRateBasedRule and by ListRateBasedRules.

updateRateBasedRule_changeToken :: Lens' UpdateRateBasedRule Text Source #

The value returned by the most recent call to GetChangeToken.

updateRateBasedRule_updates :: Lens' UpdateRateBasedRule [RuleUpdate] Source #

An array of RuleUpdate objects that you want to insert into or delete from a RateBasedRule.

updateRateBasedRule_rateLimit :: Lens' UpdateRateBasedRule Natural Source #

The maximum number of requests, which have an identical value in the field specified by the RateKey, allowed in a five-minute period. If the number of requests exceeds the RateLimit and the other predicates specified in the rule are also met, AWS WAF triggers the action that is specified for this rule.

Destructuring the Response

data UpdateRateBasedRuleResponse Source #

See: newUpdateRateBasedRuleResponse smart constructor.

Constructors

UpdateRateBasedRuleResponse' 

Fields

  • changeToken :: Maybe Text

    The ChangeToken that you used to submit the UpdateRateBasedRule request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic UpdateRateBasedRuleResponse Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

Associated Types

type Rep UpdateRateBasedRuleResponse :: Type -> Type #

Read UpdateRateBasedRuleResponse Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

Show UpdateRateBasedRuleResponse Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

NFData UpdateRateBasedRuleResponse Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

Eq UpdateRateBasedRuleResponse Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

type Rep UpdateRateBasedRuleResponse Source # 
Instance details

Defined in Amazonka.WAFRegional.UpdateRateBasedRule

type Rep UpdateRateBasedRuleResponse = D1 ('MetaData "UpdateRateBasedRuleResponse" "Amazonka.WAFRegional.UpdateRateBasedRule" "amazonka-waf-regional-2.0-83dY3vKOuQzAAW7M6EmzRI" 'False) (C1 ('MetaCons "UpdateRateBasedRuleResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "changeToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newUpdateRateBasedRuleResponse Source #

Create a value of UpdateRateBasedRuleResponse 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:

UpdateRateBasedRule, updateRateBasedRuleResponse_changeToken - The ChangeToken that you used to submit the UpdateRateBasedRule request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus.

$sel:httpStatus:UpdateRateBasedRuleResponse', updateRateBasedRuleResponse_httpStatus - The response's http status code.

Response Lenses

updateRateBasedRuleResponse_changeToken :: Lens' UpdateRateBasedRuleResponse (Maybe Text) Source #

The ChangeToken that you used to submit the UpdateRateBasedRule request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus.