Class CfnWebACL.RateBasedStatementProperty.Builder

java.lang.Object
software.amazon.awscdk.services.wafv2.CfnWebACL.RateBasedStatementProperty.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnWebACL.RateBasedStatementProperty>
Enclosing interface:
CfnWebACL.RateBasedStatementProperty

@Stability(Stable) public static final class CfnWebACL.RateBasedStatementProperty.Builder extends Object implements software.amazon.jsii.Builder<CfnWebACL.RateBasedStatementProperty>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • aggregateKeyType

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty.Builder aggregateKeyType(String aggregateKeyType)
      Parameters:
      aggregateKeyType - Setting that indicates how to aggregate the request counts. This parameter is required.

      Web requests that are missing any of the components specified in the aggregation keys are omitted from the rate-based rule evaluation and handling.

      • CONSTANT - Count and limit the requests that match the rate-based rule's scope-down statement. With this option, the counted requests aren't further aggregated. The scope-down statement is the only specification used. When the count of all requests that satisfy the scope-down statement goes over the limit, AWS WAF applies the rule action to all requests that satisfy the scope-down statement.

      With this option, you must configure the ScopeDownStatement property.

      • CUSTOM_KEYS - Aggregate the request counts using one or more web request components as the aggregate keys.

      With this option, you must specify the aggregate keys in the CustomKeys property.

      To aggregate on only the IP address or only the forwarded IP address, don't use custom keys. Instead, set the aggregate key type to IP or FORWARDED_IP .

      • FORWARDED_IP - Aggregate the request counts on the first IP address in an HTTP header.

      With this option, you must specify the header to use in the ForwardedIPConfig property.

      To aggregate on a combination of the forwarded IP address with other aggregate keys, use CUSTOM_KEYS .

      • IP - Aggregate the request counts on the IP address from the web request origin.

      To aggregate on a combination of the IP address with other aggregate keys, use CUSTOM_KEYS .

      Returns:
      this
    • limit

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty.Builder limit(Number limit)
      Parameters:
      limit - The limit on requests per 5-minute period for a single aggregation instance for the rate-based rule. This parameter is required. If the rate-based statement includes a ScopeDownStatement , this limit is applied only to the requests that match the statement.

      Examples:

      • If you aggregate on just the IP address, this is the limit on requests from any single IP address.
      • If you aggregate on the HTTP method and the query argument name "city", then this is the limit on requests for any single method, city pair.
      Returns:
      this
    • customKeys

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty.Builder customKeys(IResolvable customKeys)
      Parameters:
      customKeys - Specifies the aggregate keys to use in a rate-base rule.
      Returns:
      this
    • customKeys

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty.Builder customKeys(List<? extends Object> customKeys)
      Parameters:
      customKeys - Specifies the aggregate keys to use in a rate-base rule.
      Returns:
      this
    • evaluationWindowSec

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty.Builder evaluationWindowSec(Number evaluationWindowSec)
      Parameters:
      evaluationWindowSec - The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time. For example, for a setting of 120, when AWS WAF checks the rate, it counts the requests for the 2 minutes immediately preceding the current time. Valid settings are 60, 120, 300, and 600.

      This setting doesn't determine how often AWS WAF checks the rate, but how far back it looks each time it checks. AWS WAF checks the rate about every 10 seconds.

      Default: 300 (5 minutes)

      Returns:
      this
    • forwardedIpConfig

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty.Builder forwardedIpConfig(IResolvable forwardedIpConfig)
      Parameters:
      forwardedIpConfig - The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name.

      If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.

      This is required if you specify a forwarded IP in the rule's aggregate key settings.

      Returns:
      this
    • forwardedIpConfig

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty.Builder forwardedIpConfig(CfnWebACL.ForwardedIPConfigurationProperty forwardedIpConfig)
      Parameters:
      forwardedIpConfig - The configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify any header name.

      If the specified header isn't present in the request, AWS WAF doesn't apply the rule to the web request at all.

      This is required if you specify a forwarded IP in the rule's aggregate key settings.

      Returns:
      this
    • scopeDownStatement

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty.Builder scopeDownStatement(IResolvable scopeDownStatement)
      Parameters:
      scopeDownStatement - An optional nested statement that narrows the scope of the web requests that are evaluated and managed by the rate-based statement. When you use a scope-down statement, the rate-based rule only tracks and rate limits requests that match the scope-down statement. You can use any nestable Statement in the scope-down statement, and you can nest statements at any level, the same as you can for a rule statement.
      Returns:
      this
    • scopeDownStatement

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty.Builder scopeDownStatement(CfnWebACL.StatementProperty scopeDownStatement)
      Parameters:
      scopeDownStatement - An optional nested statement that narrows the scope of the web requests that are evaluated and managed by the rate-based statement. When you use a scope-down statement, the rate-based rule only tracks and rate limits requests that match the scope-down statement. You can use any nestable Statement in the scope-down statement, and you can nest statements at any level, the same as you can for a rule statement.
      Returns:
      this
    • build

      @Stability(Stable) public CfnWebACL.RateBasedStatementProperty build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnWebACL.RateBasedStatementProperty>
      Returns:
      a new instance of CfnWebACL.RateBasedStatementProperty
      Throws:
      NullPointerException - if any required attribute was not provided