Class: AWSCDK::WAFv2::CfnWebACL

Inherits:
CfnResource
  • Object
show all
Includes:
IInspectable, ITaggable, Interfaces::AWSWafv2::IWebACLRef
Defined in:
wa_fv2/cfn_web_acl.rb

Overview

This is the latest version of AWS WAF , named AWS WAF V2, released in November, 2019.

For information, including how to migrate your AWS WAF resources from the prior release, see the AWS WAF developer guide .

Use an WebACL to define a collection of rules to use to inspect and control web requests. Each rule in a web ACL has a statement that defines what to look for in web requests and an action that AWS WAF applies to requests that match the statement. In the web ACL, you assign a default action to take (allow, block) for any request that doesn't match any of the rules.

The rules in a web ACL can be a combination of explicitly defined rules and rule groups that you reference from the web ACL. The rule groups can be rule groups that you manage or rule groups that are managed by others.

You can associate a web ACL with one or more AWS resources to protect. The resources can be an Amazon CloudFront distribution, an REST API, an Application Load Balancer , an AWS AppSync GraphQL API , an Amazon Cognito user pool, an AWS App Runner service, an AWS Amplify application, or an AWS Verified Access instance.

For more information, see Web access control lists (web ACLs) in the AWS WAF developer guide .

Web ACLs used in AWS Shield Advanced automatic application layer DDoS mitigation

If you use Shield Advanced automatic application layer DDoS mitigation, the web ACLs that you use with automatic mitigation have a rule group rule whose name starts with ShieldMitigationRuleGroup . This rule is used for automatic mitigations and it's managed for you in the web ACL by Shield Advanced and AWS WAF . You'll see the rule listed among the web ACL rules when you view the web ACL through the AWS WAF interfaces.

When you manage the web ACL through CloudFormation interfaces, you won't see the Shield Advanced rule. CloudFormation doesn't include this type of rule in the stack drift status between the actual configuration of the web ACL and your web ACL template.

Don't add the Shield Advanced rule group rule to your web ACL template. The rule shouldn't be in your template. When you update the web ACL template in a stack, the Shield Advanced rule is maintained for you by AWS WAF in the resulting web ACL.

For more information, see Shield Advanced automatic application layer DDoS mitigation in the AWS Shield Advanced developer guide .

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ CfnWebACL

Create a new AWS::WAFv2::WebACL.

Parameters:

  • scope (Constructs::Construct)

    Scope in which this resource is defined.

  • id (String)

    Construct identifier for this resource (unique in its scope).

  • props (AWSCDK::WAFv2::CfnWebACLProps)

    Resource properties.



38
39
40
41
42
43
44
# File 'wa_fv2/cfn_web_acl.rb', line 38

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACLProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfd2FmdjIuQ2ZuV2ViQUNMUHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.arn_for_web_acl(resource) ⇒ String

Parameters:

Returns:

  • (String)


110
111
112
113
# File 'wa_fv2/cfn_web_acl.rb', line 110

def self.arn_for_web_acl(resource)
  Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c193YWZ2Mi5JV2ViQUNMUmVmIn0=")), "resource")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_wafv2.CfnWebACL", "arnForWebACL", [resource])
end

.CFN_RESOURCE_TYPE_NAMEString

The CloudFormation resource type name for this resource class.

Returns:

  • (String)


217
218
219
# File 'wa_fv2/cfn_web_acl.rb', line 217

def self.CFN_RESOURCE_TYPE_NAME()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_wafv2.CfnWebACL", "CFN_RESOURCE_TYPE_NAME")
end

.is_cfn_web_acl(x) ⇒ Boolean

Checks whether the given object is a CfnWebACL.

Parameters:

  • x (Object)

Returns:

  • (Boolean)


119
120
121
122
# File 'wa_fv2/cfn_web_acl.rb', line 119

def self.is_cfn_web_acl(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_wafv2.CfnWebACL", "isCfnWebACL", [x])
end

.jsii_overridable_methodsObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'wa_fv2/cfn_web_acl.rb', line 46

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :creation_stack => { kind: :property, name: "creationStack", is_optional: false },
    :logical_id => { kind: :property, name: "logicalId", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :ref => { kind: :property, name: "ref", is_optional: false },
    :cfn_options => { kind: :property, name: "cfnOptions", is_optional: false },
    :cfn_properties => { kind: :property, name: "cfnProperties", is_optional: false },
    :cfn_property_names => { kind: :property, name: "cfnPropertyNames", is_optional: false },
    :cfn_resource_type => { kind: :property, name: "cfnResourceType", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :updated_properites => { kind: :property, name: "updatedProperites", is_optional: false },
    :updated_properties => { kind: :property, name: "updatedProperties", is_optional: false },
    :attr_arn => { kind: :property, name: "attrArn", is_optional: false },
    :attr_capacity => { kind: :property, name: "attrCapacity", is_optional: false },
    :attr_id => { kind: :property, name: "attrId", is_optional: false },
    :attr_label_namespace => { kind: :property, name: "attrLabelNamespace", is_optional: false },
    :tags => { kind: :property, name: "tags", is_optional: false },
    :web_acl_ref => { kind: :property, name: "webAclRef", is_optional: false },
    :default_action => { kind: :property, name: "defaultAction", is_optional: false },
    :scope => { kind: :property, name: "scope", is_optional: false },
    :visibility_config => { kind: :property, name: "visibilityConfig", is_optional: false },
    :application_config => { kind: :property, name: "applicationConfig", is_optional: true },
    :association_config => { kind: :property, name: "associationConfig", is_optional: true },
    :captcha_config => { kind: :property, name: "captchaConfig", is_optional: true },
    :challenge_config => { kind: :property, name: "challengeConfig", is_optional: true },
    :custom_response_bodies => { kind: :property, name: "customResponseBodies", is_optional: true },
    :data_protection_config => { kind: :property, name: "dataProtectionConfig", is_optional: true },
    :description => { kind: :property, name: "description", is_optional: true },
    :monetization_config => { kind: :property, name: "monetizationConfig", is_optional: true },
    :name => { kind: :property, name: "name", is_optional: true },
    :on_source_d_do_s_protection_config => { kind: :property, name: "onSourceDDoSProtectionConfig", is_optional: true },
    :rules => { kind: :property, name: "rules", is_optional: true },
    :tags_raw => { kind: :property, name: "tagsRaw", is_optional: true },
    :token_domains => { kind: :property, name: "tokenDomains", is_optional: true },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :override_logical_id => { kind: :method, name: "overrideLogicalId", is_optional: false },
    :add_deletion_override => { kind: :method, name: "addDeletionOverride", is_optional: false },
    :add_dependency => { kind: :method, name: "addDependency", is_optional: false },
    :add_depends_on => { kind: :method, name: "addDependsOn", is_optional: false },
    :add_metadata => { kind: :method, name: "addMetadata", is_optional: false },
    :add_override => { kind: :method, name: "addOverride", is_optional: false },
    :add_property_deletion_override => { kind: :method, name: "addPropertyDeletionOverride", is_optional: false },
    :add_property_override => { kind: :method, name: "addPropertyOverride", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :cfn_property_name => { kind: :method, name: "cfnPropertyName", is_optional: false },
    :get_att => { kind: :method, name: "getAtt", is_optional: false },
    :get_metadata => { kind: :method, name: "getMetadata", is_optional: false },
    :obtain_dependencies => { kind: :method, name: "obtainDependencies", is_optional: false },
    :obtain_resource_dependencies => { kind: :method, name: "obtainResourceDependencies", is_optional: false },
    :remove_dependency => { kind: :method, name: "removeDependency", is_optional: false },
    :render_properties => { kind: :method, name: "renderProperties", is_optional: false },
    :replace_dependency => { kind: :method, name: "replaceDependency", is_optional: false },
    :should_synthesize => { kind: :method, name: "shouldSynthesize", is_optional: false },
    :validate_properties => { kind: :method, name: "validateProperties", is_optional: false },
    :inspect => { kind: :method, name: "inspect", is_optional: false },
  }
end

Instance Method Details

#add_deletion_override(path) ⇒ void

This method returns an undefined value.

Syntactic sugar for addOverride(path, undefined).

Parameters:

  • path (String)

    The path of the value to delete.



509
510
511
512
# File 'wa_fv2/cfn_web_acl.rb', line 509

def add_deletion_override(path)
  Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path")
  jsii_call_method("addDeletionOverride", [path])
end

#add_dependency(target) ⇒ void

This method returns an undefined value.

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters:



521
522
523
524
# File 'wa_fv2/cfn_web_acl.rb', line 521

def add_dependency(target)
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "target")
  jsii_call_method("addDependency", [target])
end

#add_depends_on(target) ⇒ void

Deprecated.

use addDependency

This method returns an undefined value.

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

Parameters:



531
532
533
534
# File 'wa_fv2/cfn_web_acl.rb', line 531

def add_depends_on(target)
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "target")
  jsii_call_method("addDependsOn", [target])
end

#add_metadata(key, value) ⇒ void

This method returns an undefined value.

Add a value to the CloudFormation Resource Metadata.



542
543
544
545
546
# File 'wa_fv2/cfn_web_acl.rb', line 542

def (key, value)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_call_method("addMetadata", [key, value])
end

#add_override(path, value) ⇒ void

This method returns an undefined value.

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use add_property_override or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

# Example automatically generated from non-compiling source. May contain errors.
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides

"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to add_override will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters:

  • path (String)
    • The path of the property, you can use dot notation to override values in complex types.
  • value (Object)
    • The value.


599
600
601
602
603
# File 'wa_fv2/cfn_web_acl.rb', line 599

def add_override(path, value)
  Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_call_method("addOverride", [path, value])
end

#add_property_deletion_override(property_path) ⇒ void

This method returns an undefined value.

Adds an override that deletes the value of a property from the resource definition.

Parameters:

  • property_path (String)

    The path to the property.



609
610
611
612
# File 'wa_fv2/cfn_web_acl.rb', line 609

def add_property_deletion_override(property_path)
  Jsii::Type.check_type(property_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "propertyPath")
  jsii_call_method("addPropertyDeletionOverride", [property_path])
end

#add_property_override(property_path, value) ⇒ void

This method returns an undefined value.

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters:

  • property_path (String)

    The path of the property.

  • value (Object)

    The value.



621
622
623
624
625
# File 'wa_fv2/cfn_web_acl.rb', line 621

def add_property_override(property_path, value)
  Jsii::Type.check_type(property_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "propertyPath")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_call_method("addPropertyOverride", [property_path, value])
end

#application_configAWSCDK::IResolvable, ...

Returns a list of ApplicationAttribute s.



312
313
314
# File 'wa_fv2/cfn_web_acl.rb', line 312

def application_config()
  jsii_get_property("applicationConfig")
end

#application_config=(value) ⇒ Object



316
317
318
319
320
# File 'wa_fv2/cfn_web_acl.rb', line 316

def application_config=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::ApplicationConfigProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuQXBwbGljYXRpb25Db25maWdQcm9wZXJ0eSJ9XX19")), "applicationConfig") unless value.nil?
  jsii_set_property("applicationConfig", value)
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Sets the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.

Parameters:



634
635
636
637
# File 'wa_fv2/cfn_web_acl.rb', line 634

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#apply_removal_policy(policy = nil, options = nil) ⇒ void

This method returns an undefined value.

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:



656
657
658
659
660
661
# File 'wa_fv2/cfn_web_acl.rb', line 656

def apply_removal_policy(policy = nil, options = nil)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") unless policy.nil?
  options = options.is_a?(Hash) ? ::AWSCDK::RemovalPolicyOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5T3B0aW9ucyJ9")), "options") unless options.nil?
  jsii_call_method("applyRemovalPolicy", [policy, options])
end

#association_configAWSCDK::IResolvable, ...

Specifies custom configurations for the associations between the web ACL and protected resources.



325
326
327
# File 'wa_fv2/cfn_web_acl.rb', line 325

def association_config()
  jsii_get_property("associationConfig")
end

#association_config=(value) ⇒ Object



329
330
331
332
333
# File 'wa_fv2/cfn_web_acl.rb', line 329

def association_config=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::AssociationConfigProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuQXNzb2NpYXRpb25Db25maWdQcm9wZXJ0eSJ9XX19")), "associationConfig") unless value.nil?
  jsii_set_property("associationConfig", value)
end

#attr_arnString

The Amazon Resource Name (ARN) of the web ACL.

Returns:

  • (String)


224
225
226
# File 'wa_fv2/cfn_web_acl.rb', line 224

def attr_arn()
  jsii_get_property("attrArn")
end

#attr_capacityNumeric

The web ACL capacity units (WCUs) currently being used by this web ACL.

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.

Returns:

  • (Numeric)


233
234
235
# File 'wa_fv2/cfn_web_acl.rb', line 233

def attr_capacity()
  jsii_get_property("attrCapacity")
end

#attr_idString

The ID of the web ACL.

Returns:

  • (String)


240
241
242
# File 'wa_fv2/cfn_web_acl.rb', line 240

def attr_id()
  jsii_get_property("attrId")
end

#attr_label_namespaceString

The label namespace prefix for this web ACL.

All labels added by rules in this web ACL have this prefix.

The syntax for the label namespace prefix for a web ACL is the following: awswaf:<account ID>:webacl:<web ACL name>:

When a rule with a label matches a web request, AWS WAF adds the fully qualified label to the request. A fully qualified label is made up of the label namespace from the rule group or web ACL where the rule is defined and the label from the rule, separated by a colon.

Returns:

  • (String)


253
254
255
# File 'wa_fv2/cfn_web_acl.rb', line 253

def attr_label_namespace()
  jsii_get_property("attrLabelNamespace")
end

#captcha_configAWSCDK::IResolvable, ...

Specifies how AWS WAF should handle CAPTCHA evaluations for rules that don't have their own CaptchaConfig settings.



338
339
340
# File 'wa_fv2/cfn_web_acl.rb', line 338

def captcha_config()
  jsii_get_property("captchaConfig")
end

#captcha_config=(value) ⇒ Object



342
343
344
345
346
# File 'wa_fv2/cfn_web_acl.rb', line 342

def captcha_config=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::CaptchaConfigProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuQ2FwdGNoYUNvbmZpZ1Byb3BlcnR5In1dfX0=")), "captchaConfig") unless value.nil?
  jsii_set_property("captchaConfig", value)
end

#cfn_optionsAWSCDK::ICfnResourceOptions

Options for this resource, such as condition, update policy etc.



170
171
172
# File 'wa_fv2/cfn_web_acl.rb', line 170

def cfn_options()
  jsii_get_property("cfnOptions")
end

#cfn_propertiesHash{String => Object}

Returns:

  • (Hash{String => Object})


175
176
177
# File 'wa_fv2/cfn_web_acl.rb', line 175

def cfn_properties()
  jsii_get_property("cfnProperties")
end

#cfn_property_name(cdk_property_name) ⇒ String?

Parameters:

  • cdk_property_name (String)

Returns:

  • (String, nil)


665
666
667
668
# File 'wa_fv2/cfn_web_acl.rb', line 665

def cfn_property_name(cdk_property_name)
  Jsii::Type.check_type(cdk_property_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cdkPropertyName")
  jsii_call_method("cfnPropertyName", [cdk_property_name])
end

#cfn_property_namesHash{String => String}

Returns:

  • (Hash{String => String})


180
181
182
# File 'wa_fv2/cfn_web_acl.rb', line 180

def cfn_property_names()
  jsii_get_property("cfnPropertyNames")
end

#cfn_resource_typeString

AWS resource type.

Returns:

  • (String)


187
188
189
# File 'wa_fv2/cfn_web_acl.rb', line 187

def cfn_resource_type()
  jsii_get_property("cfnResourceType")
end

#challenge_configAWSCDK::IResolvable, ...

Specifies how AWS WAF should handle challenge evaluations for rules that don't have their own ChallengeConfig settings.



351
352
353
# File 'wa_fv2/cfn_web_acl.rb', line 351

def challenge_config()
  jsii_get_property("challengeConfig")
end

#challenge_config=(value) ⇒ Object



355
356
357
358
359
# File 'wa_fv2/cfn_web_acl.rb', line 355

def challenge_config=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::ChallengeConfigProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuQ2hhbGxlbmdlQ29uZmlnUHJvcGVydHkifV19fQ==")), "challengeConfig") unless value.nil?
  jsii_set_property("challengeConfig", value)
end

#creation_stackArray<String>

Returns:

  • (Array<String>)


132
133
134
# File 'wa_fv2/cfn_web_acl.rb', line 132

def creation_stack()
  jsii_get_property("creationStack")
end

#custom_response_bodiesAWSCDK::IResolvable, ...

A map of custom response keys and content bodies.



364
365
366
# File 'wa_fv2/cfn_web_acl.rb', line 364

def custom_response_bodies()
  jsii_get_property("customResponseBodies")
end

#custom_response_bodies=(value) ⇒ Object



368
369
370
371
# File 'wa_fv2/cfn_web_acl.rb', line 368

def custom_response_bodies=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfd2FmdjIuQ2ZuV2ViQUNMLkN1c3RvbVJlc3BvbnNlQm9keVByb3BlcnR5In1dfX0sImtpbmQiOiJtYXAifX1dfX0=")), "customResponseBodies") unless value.nil?
  jsii_set_property("customResponseBodies", value)
end

#data_protection_configAWSCDK::IResolvable, ...

Specifies data protection to apply to the web request data for the web ACL.



376
377
378
# File 'wa_fv2/cfn_web_acl.rb', line 376

def data_protection_config()
  jsii_get_property("dataProtectionConfig")
end

#data_protection_config=(value) ⇒ Object



380
381
382
383
384
# File 'wa_fv2/cfn_web_acl.rb', line 380

def data_protection_config=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::DataProtectionConfigProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuRGF0YVByb3RlY3Rpb25Db25maWdQcm9wZXJ0eSJ9XX19")), "dataProtectionConfig") unless value.nil?
  jsii_set_property("dataProtectionConfig", value)
end

#default_actionAWSCDK::IResolvable, AWSCDK::WAFv2::CfnWebACL::DefaultActionProperty

The action to perform if none of the Rules contained in the WebACL match.



274
275
276
# File 'wa_fv2/cfn_web_acl.rb', line 274

def default_action()
  jsii_get_property("defaultAction")
end

#default_action=(value) ⇒ Object



278
279
280
281
282
# File 'wa_fv2/cfn_web_acl.rb', line 278

def default_action=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::DefaultActionProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuRGVmYXVsdEFjdGlvblByb3BlcnR5In1dfX0=")), "defaultAction")
  jsii_set_property("defaultAction", value)
end

#descriptionString?

A description of the web ACL that helps with identification.

Returns:

  • (String, nil)


389
390
391
# File 'wa_fv2/cfn_web_acl.rb', line 389

def description()
  jsii_get_property("description")
end

#description=(value) ⇒ Object



393
394
395
396
# File 'wa_fv2/cfn_web_acl.rb', line 393

def description=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless value.nil?
  jsii_set_property("description", value)
end

#envAWSCDK::Interfaces::ResourceEnvironment



192
193
194
# File 'wa_fv2/cfn_web_acl.rb', line 192

def env()
  jsii_get_property("env")
end

#get_att(attribute_name, type_hint = nil) ⇒ AWSCDK::Reference

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters:

Returns:



678
679
680
681
682
# File 'wa_fv2/cfn_web_acl.rb', line 678

def get_att(attribute_name, type_hint = nil)
  Jsii::Type.check_type(attribute_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "attributeName")
  Jsii::Type.check_type(type_hint, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZXNvbHV0aW9uVHlwZUhpbnQifQ==")), "typeHint") unless type_hint.nil?
  jsii_call_method("getAtt", [attribute_name, type_hint])
end

#get_metadata(key) ⇒ Object

Retrieve a value value from the CloudFormation Resource Metadata.



689
690
691
692
# File 'wa_fv2/cfn_web_acl.rb', line 689

def (key)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  jsii_call_method("getMetadata", [key])
end

#inspect(inspector) ⇒ void

This method returns an undefined value.

Examines the CloudFormation resource and discloses attributes.

Parameters:



759
760
761
762
# File 'wa_fv2/cfn_web_acl.rb', line 759

def inspect(inspector)
  Jsii::Type.check_type(inspector, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5UcmVlSW5zcGVjdG9yIn0=")), "inspector")
  jsii_call_method("inspect", [inspector])
end

#logical_idString

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use override_logical_id(new_logical_id).

Returns:

  • (String)


144
145
146
# File 'wa_fv2/cfn_web_acl.rb', line 144

def logical_id()
  jsii_get_property("logicalId")
end

#monetization_configAWSCDK::IResolvable, ...

Configures monetization for the web ACL or rule group.



401
402
403
# File 'wa_fv2/cfn_web_acl.rb', line 401

def monetization_config()
  jsii_get_property("monetizationConfig")
end

#monetization_config=(value) ⇒ Object



405
406
407
408
409
# File 'wa_fv2/cfn_web_acl.rb', line 405

def monetization_config=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::MonetizationConfigProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuTW9uZXRpemF0aW9uQ29uZmlnUHJvcGVydHkifV19fQ==")), "monetizationConfig") unless value.nil?
  jsii_set_property("monetizationConfig", value)
end

#nameString?

The name of the web ACL.

Returns:

  • (String, nil)


414
415
416
# File 'wa_fv2/cfn_web_acl.rb', line 414

def name()
  jsii_get_property("name")
end

#name=(value) ⇒ Object



418
419
420
421
# File 'wa_fv2/cfn_web_acl.rb', line 418

def name=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless value.nil?
  jsii_set_property("name", value)
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


127
128
129
# File 'wa_fv2/cfn_web_acl.rb', line 127

def node()
  jsii_get_property("node")
end

#obtain_dependenciesArray<AWSCDK::CfnResource, AWSCDK::Stack>

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Returns:



700
701
702
# File 'wa_fv2/cfn_web_acl.rb', line 700

def obtain_dependencies()
  jsii_call_method("obtainDependencies", [])
end

#obtain_resource_dependenciesArray<AWSCDK::CfnResource>

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Returns:



707
708
709
# File 'wa_fv2/cfn_web_acl.rb', line 707

def obtain_resource_dependencies()
  jsii_call_method("obtainResourceDependencies", [])
end

#on_source_d_do_s_protection_configAWSCDK::IResolvable, ...

Configures the level of DDoS protection that applies to web ACLs associated with Application Load Balancers.



426
427
428
# File 'wa_fv2/cfn_web_acl.rb', line 426

def on_source_d_do_s_protection_config()
  jsii_get_property("onSourceDDoSProtectionConfig")
end

#on_source_d_do_s_protection_config=(value) ⇒ Object



430
431
432
433
434
# File 'wa_fv2/cfn_web_acl.rb', line 430

def on_source_d_do_s_protection_config=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::OnSourceDDoSProtectionConfigProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuT25Tb3VyY2VERG9TUHJvdGVjdGlvbkNvbmZpZ1Byb3BlcnR5In1dfX0=")), "onSourceDDoSProtectionConfig") unless value.nil?
  jsii_set_property("onSourceDDoSProtectionConfig", value)
end

#override_logical_id(new_logical_id) ⇒ void

This method returns an undefined value.

Overrides the auto-generated logical ID with a specific ID.

Parameters:

  • new_logical_id (String)

    The new logical ID to use for this stack element.



500
501
502
503
# File 'wa_fv2/cfn_web_acl.rb', line 500

def override_logical_id(new_logical_id)
  Jsii::Type.check_type(new_logical_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "newLogicalId")
  jsii_call_method("overrideLogicalId", [new_logical_id])
end

#refString

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Returns:

  • (String)


163
164
165
# File 'wa_fv2/cfn_web_acl.rb', line 163

def ref()
  jsii_get_property("ref")
end

#remove_dependency(target) ⇒ void

This method returns an undefined value.

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:



718
719
720
721
# File 'wa_fv2/cfn_web_acl.rb', line 718

def remove_dependency(target)
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "target")
  jsii_call_method("removeDependency", [target])
end

#render_properties(props) ⇒ Hash{String => Object}

Parameters:

  • props (Hash{String => Object})

Returns:

  • (Hash{String => Object})


725
726
727
728
# File 'wa_fv2/cfn_web_acl.rb', line 725

def render_properties(props)
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "props")
  jsii_call_method("renderProperties", [props])
end

#replace_dependency(target, new_target) ⇒ void

This method returns an undefined value.

Replaces one dependency with another.

Parameters:



735
736
737
738
739
# File 'wa_fv2/cfn_web_acl.rb', line 735

def replace_dependency(target, new_target)
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "target")
  Jsii::Type.check_type(new_target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "newTarget")
  jsii_call_method("replaceDependency", [target, new_target])
end

#rulesAWSCDK::IResolvable, ...

The rule statements used to identify the web requests that you want to manage.



439
440
441
# File 'wa_fv2/cfn_web_acl.rb', line 439

def rules()
  jsii_get_property("rules")
end

#rules=(value) ⇒ Object



443
444
445
446
# File 'wa_fv2/cfn_web_acl.rb', line 443

def rules=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfd2FmdjIuQ2ZuV2ViQUNMLlJ1bGVQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "rules") unless value.nil?
  jsii_set_property("rules", value)
end

#scopeString

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

Returns:

  • (String)


287
288
289
# File 'wa_fv2/cfn_web_acl.rb', line 287

def scope()
  jsii_get_property("scope")
end

#scope=(value) ⇒ Object



291
292
293
294
# File 'wa_fv2/cfn_web_acl.rb', line 291

def scope=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "scope")
  jsii_set_property("scope", value)
end

#should_synthesizeBoolean

Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.

Returns:

  • (Boolean)

    true if the resource should be included or false is the resource should be omitted.



744
745
746
# File 'wa_fv2/cfn_web_acl.rb', line 744

def should_synthesize()
  jsii_call_method("shouldSynthesize", [])
end

#stackAWSCDK::Stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Returns:



153
154
155
# File 'wa_fv2/cfn_web_acl.rb', line 153

def stack()
  jsii_get_property("stack")
end

#tagsAWSCDK::TagManager

Tag Manager which manages the tags for this resource.

Returns:



260
261
262
# File 'wa_fv2/cfn_web_acl.rb', line 260

def tags()
  jsii_get_property("tags")
end

#tags_rawArray<AWSCDK::CfnTag>?

Key:value pairs associated with an AWS resource.

Returns:



451
452
453
# File 'wa_fv2/cfn_web_acl.rb', line 451

def tags_raw()
  jsii_get_property("tagsRaw")
end

#tags_raw=(value) ⇒ Object



455
456
457
458
459
# File 'wa_fv2/cfn_web_acl.rb', line 455

def tags_raw=(value)
  value = value.is_a?(Array) ? value.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tagsRaw") unless value.nil?
  jsii_set_property("tagsRaw", value)
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)

    a string representation of this resource



476
477
478
# File 'wa_fv2/cfn_web_acl.rb', line 476

def to_string()
  jsii_call_method("toString", [])
end

#token_domainsArray<String>?

Specifies the domains that AWS WAF should accept in a web request token.

Returns:

  • (Array<String>, nil)


464
465
466
# File 'wa_fv2/cfn_web_acl.rb', line 464

def token_domains()
  jsii_get_property("tokenDomains")
end

#token_domains=(value) ⇒ Object



468
469
470
471
# File 'wa_fv2/cfn_web_acl.rb', line 468

def token_domains=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tokenDomains") unless value.nil?
  jsii_set_property("tokenDomains", value)
end

#updated_properitesHash{String => Object}

Deprecated.

use updatedProperties Return properties modified after initiation Resources that expose mutable properties should override this function to collect and return the properties object for this resource.

Deprecated.

Returns:

  • (Hash{String => Object})


200
201
202
# File 'wa_fv2/cfn_web_acl.rb', line 200

def updated_properites()
  jsii_get_property("updatedProperites")
end

#updated_propertiesHash{String => Object}

Return properties modified after initiation.

Resources that expose mutable properties should override this function to collect and return the properties object for this resource.

Returns:

  • (Hash{String => Object})


210
211
212
# File 'wa_fv2/cfn_web_acl.rb', line 210

def updated_properties()
  jsii_get_property("updatedProperties")
end

#validate_properties(_properties) ⇒ void

This method returns an undefined value.

Parameters:

  • _properties (Object)


750
751
752
753
# File 'wa_fv2/cfn_web_acl.rb', line 750

def validate_properties(_properties)
  Jsii::Type.check_type(_properties, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "_properties")
  jsii_call_method("validateProperties", [_properties])
end

#visibility_configAWSCDK::IResolvable, AWSCDK::WAFv2::CfnWebACL::VisibilityConfigProperty

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



299
300
301
# File 'wa_fv2/cfn_web_acl.rb', line 299

def visibility_config()
  jsii_get_property("visibilityConfig")
end

#visibility_config=(value) ⇒ Object



303
304
305
306
307
# File 'wa_fv2/cfn_web_acl.rb', line 303

def visibility_config=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::VisibilityConfigProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuVmlzaWJpbGl0eUNvbmZpZ1Byb3BlcnR5In1dfX0=")), "visibilityConfig")
  jsii_set_property("visibilityConfig", value)
end

#web_acl_refAWSCDK::Interfaces::AWSWafv2::WebACLReference

A reference to a WebACL resource.



267
268
269
# File 'wa_fv2/cfn_web_acl.rb', line 267

def web_acl_ref()
  jsii_get_property("webAclRef")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


489
490
491
492
493
494
# File 'wa_fv2/cfn_web_acl.rb', line 489

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end