Class: AWSCDK::WAFv2::CfnRuleGroup::VisibilityConfigProperty

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

Overview

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cloud_watch_metrics_enabled:, metric_name:, sampled_requests_enabled:) ⇒ VisibilityConfigProperty

Returns a new instance of VisibilityConfigProperty.

Parameters:

  • cloud_watch_metrics_enabled (Boolean, AWSCDK::IResolvable)

    Indicates whether the associated resource sends metrics to Amazon CloudWatch.

  • metric_name (String)

    A name of the Amazon CloudWatch metric dimension.

  • sampled_requests_enabled (Boolean, AWSCDK::IResolvable)

    Indicates whether AWS WAF should store a sampling of the web requests that match the rules.



4423
4424
4425
4426
4427
4428
4429
4430
# File 'wa_fv2/cfn_rule_group.rb', line 4423

def initialize(cloud_watch_metrics_enabled:, metric_name:, sampled_requests_enabled:)
  @cloud_watch_metrics_enabled = cloud_watch_metrics_enabled
  Jsii::Type.check_type(@cloud_watch_metrics_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "cloudWatchMetricsEnabled")
  @metric_name = metric_name
  Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  @sampled_requests_enabled = sampled_requests_enabled
  Jsii::Type.check_type(@sampled_requests_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "sampledRequestsEnabled")
end

Instance Attribute Details

#cloud_watch_metrics_enabledBoolean, AWSCDK::IResolvable (readonly)

Indicates whether the associated resource sends metrics to Amazon CloudWatch.

For the list of available metrics, see AWS WAF Metrics in the AWS WAF Developer Guide .

For web ACLs, the metrics are for web requests that have the web ACL default action applied. AWS WAF applies the default action to web requests that pass the inspection of all rules in the web ACL without being either allowed or blocked. For more information, see The web ACL default action in the AWS WAF Developer Guide .



4441
4442
4443
# File 'wa_fv2/cfn_rule_group.rb', line 4441

def cloud_watch_metrics_enabled
  @cloud_watch_metrics_enabled
end

#metric_nameString (readonly)

A name of the Amazon CloudWatch metric dimension.

The name can contain only the characters: A-Z, a-z, 0-9, - (hyphen), and _ (underscore). The name can be from one to 128 characters long. It can't contain whitespace or metric names that are reserved for AWS WAF , for example All and Default_Action .



4448
4449
4450
# File 'wa_fv2/cfn_rule_group.rb', line 4448

def metric_name
  @metric_name
end

#sampled_requests_enabledBoolean, AWSCDK::IResolvable (readonly)

Indicates whether AWS WAF should store a sampling of the web requests that match the rules.

You can view the sampled requests through the AWS WAF console.

If you configure data protection for the web ACL, the protection applies to the web ACL's sampled web request data.

Request sampling doesn't provide a field redaction option, and any field redaction that you specify in your logging configuration doesn't affect sampling. You can only exclude fields from request sampling by disabling sampling in the web ACL visibility configuration or by configuring data protection for the web ACL.



4459
4460
4461
# File 'wa_fv2/cfn_rule_group.rb', line 4459

def sampled_requests_enabled
  @sampled_requests_enabled
end

Class Method Details

.jsii_propertiesObject



4461
4462
4463
4464
4465
4466
4467
# File 'wa_fv2/cfn_rule_group.rb', line 4461

def self.jsii_properties
  {
    :cloud_watch_metrics_enabled => "cloudWatchMetricsEnabled",
    :metric_name => "metricName",
    :sampled_requests_enabled => "sampledRequestsEnabled",
  }
end

Instance Method Details

#to_jsiiObject



4469
4470
4471
4472
4473
4474
4475
4476
4477
# File 'wa_fv2/cfn_rule_group.rb', line 4469

def to_jsii
  result = {}
  result.merge!({
    "cloudWatchMetricsEnabled" => @cloud_watch_metrics_enabled,
    "metricName" => @metric_name,
    "sampledRequestsEnabled" => @sampled_requests_enabled,
  })
  result.compact
end