Class CfnRuleGroup.Builder

java.lang.Object
software.amazon.awscdk.services.wafv2.CfnRuleGroup.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnRuleGroup>
Enclosing class:
CfnRuleGroup

@Stability(Stable) public static final class CfnRuleGroup.Builder extends Object implements software.amazon.jsii.Builder<CfnRuleGroup>
A fluent builder for CfnRuleGroup.
  • Method Details

    • create

      @Stability(Stable) public static CfnRuleGroup.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnRuleGroup.Builder.
    • capacity

      @Stability(Stable) public CfnRuleGroup.Builder capacity(Number capacity)
      The web ACL capacity units (WCUs) required for this rule group.

      When you create your own rule group, you define this, and you cannot change it after creation. When you add or modify the rules in a rule group, AWS WAF enforces this limit.

      AWS WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500.

      Parameters:
      capacity - The web ACL capacity units (WCUs) required for this rule group. This parameter is required.
      Returns:
      this
    • scope

      @Stability(Stable) public CfnRuleGroup.Builder scope(String scope)
      Specifies whether this is for an Amazon CloudFront distribution or for a regional application.

      A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, or an AWS App Runner service. Valid Values are CLOUDFRONT and REGIONAL .

      For CLOUDFRONT , you must create your WAFv2 resources in the US East (N. Virginia) Region, us-east-1 .

      Parameters:
      scope - Specifies whether this is for an Amazon CloudFront distribution or for a regional application. This parameter is required.
      Returns:
      this
    • visibilityConfig

      @Stability(Stable) public CfnRuleGroup.Builder visibilityConfig(IResolvable visibilityConfig)
      Defines and enables Amazon CloudWatch metrics and web request sample collection.

      Parameters:
      visibilityConfig - Defines and enables Amazon CloudWatch metrics and web request sample collection. This parameter is required.
      Returns:
      this
    • visibilityConfig

      @Stability(Stable) public CfnRuleGroup.Builder visibilityConfig(CfnRuleGroup.VisibilityConfigProperty visibilityConfig)
      Defines and enables Amazon CloudWatch metrics and web request sample collection.

      Parameters:
      visibilityConfig - Defines and enables Amazon CloudWatch metrics and web request sample collection. This parameter is required.
      Returns:
      this
    • availableLabels

      @Stability(Stable) public CfnRuleGroup.Builder availableLabels(IResolvable availableLabels)
      The labels that one or more rules in this rule group add to matching web requests.

      These labels are defined in the RuleLabels for a Rule .

      Parameters:
      availableLabels - The labels that one or more rules in this rule group add to matching web requests. This parameter is required.
      Returns:
      this
    • availableLabels

      @Stability(Stable) public CfnRuleGroup.Builder availableLabels(List<? extends Object> availableLabels)
      The labels that one or more rules in this rule group add to matching web requests.

      These labels are defined in the RuleLabels for a Rule .

      Parameters:
      availableLabels - The labels that one or more rules in this rule group add to matching web requests. This parameter is required.
      Returns:
      this
    • consumedLabels

      @Stability(Stable) public CfnRuleGroup.Builder consumedLabels(IResolvable consumedLabels)
      The labels that one or more rules in this rule group match against in label match statements.

      These labels are defined in a LabelMatchStatement specification, in the Statement definition of a rule.

      Parameters:
      consumedLabels - The labels that one or more rules in this rule group match against in label match statements. This parameter is required.
      Returns:
      this
    • consumedLabels

      @Stability(Stable) public CfnRuleGroup.Builder consumedLabels(List<? extends Object> consumedLabels)
      The labels that one or more rules in this rule group match against in label match statements.

      These labels are defined in a LabelMatchStatement specification, in the Statement definition of a rule.

      Parameters:
      consumedLabels - The labels that one or more rules in this rule group match against in label match statements. This parameter is required.
      Returns:
      this
    • customResponseBodies

      @Stability(Stable) public CfnRuleGroup.Builder customResponseBodies(IResolvable customResponseBodies)
      A map of custom response keys and content bodies.

      When you create a rule with a block action, you can send a custom response to the web request. You define these for the rule group, and then use them in the rules that you define in the rule group.

      For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

      For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

      Parameters:
      customResponseBodies - A map of custom response keys and content bodies. This parameter is required.
      Returns:
      this
    • customResponseBodies

      @Stability(Stable) public CfnRuleGroup.Builder customResponseBodies(Map<String,? extends Object> customResponseBodies)
      A map of custom response keys and content bodies.

      When you create a rule with a block action, you can send a custom response to the web request. You define these for the rule group, and then use them in the rules that you define in the rule group.

      For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .

      For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .

      Parameters:
      customResponseBodies - A map of custom response keys and content bodies. This parameter is required.
      Returns:
      this
    • description

      @Stability(Stable) public CfnRuleGroup.Builder description(String description)
      A description of the rule group that helps with identification.

      Parameters:
      description - A description of the rule group that helps with identification. This parameter is required.
      Returns:
      this
    • name

      @Stability(Stable) public CfnRuleGroup.Builder name(String name)
      The name of the rule group.

      You cannot change the name of a rule group after you create it.

      Parameters:
      name - The name of the rule group. This parameter is required.
      Returns:
      this
    • rules

      @Stability(Stable) public CfnRuleGroup.Builder rules(IResolvable rules)
      The rule statements used to identify the web requests that you want to allow, block, or count.

      Each rule includes one top-level statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.

      Parameters:
      rules - The rule statements used to identify the web requests that you want to allow, block, or count. This parameter is required.
      Returns:
      this
    • rules

      @Stability(Stable) public CfnRuleGroup.Builder rules(List<? extends Object> rules)
      The rule statements used to identify the web requests that you want to allow, block, or count.

      Each rule includes one top-level statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.

      Parameters:
      rules - The rule statements used to identify the web requests that you want to allow, block, or count. This parameter is required.
      Returns:
      this
    • tags

      @Stability(Stable) public CfnRuleGroup.Builder tags(List<? extends CfnTag> tags)
      Key:value pairs associated with an AWS resource.

      The key:value pair can be anything you define. Typically, the tag key represents a category (such as "environment") and the tag value represents a specific value within that category (such as "test," "development," or "production"). You can add up to 50 tags to each AWS resource.

      To modify tags on existing resources, use the AWS WAF APIs or command line interface. With AWS CloudFormation , you can only add tags to AWS WAF resources during resource creation.

      Parameters:
      tags - Key:value pairs associated with an AWS resource. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnRuleGroup build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnRuleGroup>
      Returns:
      a newly built instance of CfnRuleGroup.