Class: AWSCDK::WAFv2::CfnRuleGroupProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
wa_fv2/cfn_rule_group_props.rb

Overview

Properties for defining a CfnRuleGroup.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(capacity:, scope:, visibility_config:, available_labels: nil, consumed_labels: nil, custom_response_bodies: nil, description: nil, monetization_config: nil, name: nil, rules: nil, tags: nil) ⇒ CfnRuleGroupProps

Returns a new instance of CfnRuleGroupProps.

Parameters:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'wa_fv2/cfn_rule_group_props.rb', line 20

def initialize(capacity:, scope:, visibility_config:, available_labels: nil, consumed_labels: nil, custom_response_bodies: nil, description: nil, monetization_config: nil, name: nil, rules: nil, tags: nil)
  @capacity = capacity
  Jsii::Type.check_type(@capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "capacity")
  @scope = scope
  Jsii::Type.check_type(@scope, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "scope")
  @visibility_config = visibility_config.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnRuleGroup::VisibilityConfigProperty.new(**visibility_config.transform_keys(&:to_sym)) : visibility_config
  Jsii::Type.check_type(@visibility_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuVmlzaWJpbGl0eUNvbmZpZ1Byb3BlcnR5In1dfX0=")), "visibilityConfig")
  @available_labels = available_labels
  Jsii::Type.check_type(@available_labels, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfd2FmdjIuQ2ZuUnVsZUdyb3VwLkxhYmVsU3VtbWFyeVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "availableLabels") unless @available_labels.nil?
  @consumed_labels = consumed_labels
  Jsii::Type.check_type(@consumed_labels, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfd2FmdjIuQ2ZuUnVsZUdyb3VwLkxhYmVsU3VtbWFyeVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "consumedLabels") unless @consumed_labels.nil?
  @custom_response_bodies = custom_response_bodies
  Jsii::Type.check_type(@custom_response_bodies, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfd2FmdjIuQ2ZuUnVsZUdyb3VwLkN1c3RvbVJlc3BvbnNlQm9keVByb3BlcnR5In1dfX0sImtpbmQiOiJtYXAifX1dfX0=")), "customResponseBodies") unless @custom_response_bodies.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @monetization_config = monetization_config.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnRuleGroup::MonetizationConfigProperty.new(**monetization_config.transform_keys(&:to_sym)) : monetization_config
  Jsii::Type.check_type(@monetization_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuTW9uZXRpemF0aW9uQ29uZmlnUHJvcGVydHkifV19fQ==")), "monetizationConfig") unless @monetization_config.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @rules = rules
  Jsii::Type.check_type(@rules, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfd2FmdjIuQ2ZuUnVsZUdyb3VwLlJ1bGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "rules") unless @rules.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#available_labelsAWSCDK::IResolvable, ... (readonly)

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 .



74
75
76
# File 'wa_fv2/cfn_rule_group_props.rb', line 74

def available_labels
  @available_labels
end

#capacityNumeric (readonly)

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.



53
54
55
# File 'wa_fv2/cfn_rule_group_props.rb', line 53

def capacity
  @capacity
end

#consumed_labelsAWSCDK::IResolvable, ... (readonly)

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.



81
82
83
# File 'wa_fv2/cfn_rule_group_props.rb', line 81

def consumed_labels
  @consumed_labels
end

#custom_response_bodiesAWSCDK::IResolvable, ... (readonly)

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 .



92
93
94
# File 'wa_fv2/cfn_rule_group_props.rb', line 92

def custom_response_bodies
  @custom_response_bodies
end

#descriptionString? (readonly)

A description of the rule group that helps with identification.



97
98
99
# File 'wa_fv2/cfn_rule_group_props.rb', line 97

def description
  @description
end

#monetization_configAWSCDK::IResolvable, ... (readonly)

Configures monetization for the web ACL or rule group.



102
103
104
# File 'wa_fv2/cfn_rule_group_props.rb', line 102

def monetization_config
  @monetization_config
end

#nameString? (readonly)

The name of the rule group.

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



109
110
111
# File 'wa_fv2/cfn_rule_group_props.rb', line 109

def name
  @name
end

#rulesAWSCDK::IResolvable, ... (readonly)

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.



116
117
118
# File 'wa_fv2/cfn_rule_group_props.rb', line 116

def rules
  @rules
end

#scopeString (readonly)

Specifies whether this is for an Amazon CloudFront distribution or for a regional application.

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

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



62
63
64
# File 'wa_fv2/cfn_rule_group_props.rb', line 62

def scope
  @scope
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

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.



125
126
127
# File 'wa_fv2/cfn_rule_group_props.rb', line 125

def tags
  @tags
end

#visibility_configAWSCDK::IResolvable, AWSCDK::WAFv2::CfnRuleGroup::VisibilityConfigProperty (readonly)

Defines and enables Amazon CloudWatch metrics and web request sample collection.



67
68
69
# File 'wa_fv2/cfn_rule_group_props.rb', line 67

def visibility_config
  @visibility_config
end

Class Method Details

.jsii_propertiesObject



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'wa_fv2/cfn_rule_group_props.rb', line 127

def self.jsii_properties
  {
    :capacity => "capacity",
    :scope => "scope",
    :visibility_config => "visibilityConfig",
    :available_labels => "availableLabels",
    :consumed_labels => "consumedLabels",
    :custom_response_bodies => "customResponseBodies",
    :description => "description",
    :monetization_config => "monetizationConfig",
    :name => "name",
    :rules => "rules",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'wa_fv2/cfn_rule_group_props.rb', line 143

def to_jsii
  result = {}
  result.merge!({
    "capacity" => @capacity,
    "scope" => @scope,
    "visibilityConfig" => @visibility_config,
    "availableLabels" => @available_labels,
    "consumedLabels" => @consumed_labels,
    "customResponseBodies" => @custom_response_bodies,
    "description" => @description,
    "monetizationConfig" => @monetization_config,
    "name" => @name,
    "rules" => @rules,
    "tags" => @tags,
  })
  result.compact
end