Class: AWSCDK::Shield::CfnProtectionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
shield/cfn_protection_props.rb

Overview

Properties for defining a CfnProtection.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, resource_arn:, application_layer_automatic_response_configuration: nil, health_check_arns: nil, tags: nil) ⇒ CfnProtectionProps

Returns a new instance of CfnProtectionProps.

Parameters:

  • name (String)

    The name of the protection. For example, My CloudFront distributions .

  • resource_arn (String)

    The ARN (Amazon Resource Name) of the AWS resource that is protected.

  • application_layer_automatic_response_configuration (AWSCDK::IResolvable, AWSCDK::Shield::CfnProtection::ApplicationLayerAutomaticResponseConfigurationProperty, nil) (defaults to: nil)

    The automatic application layer DDoS mitigation settings for the protection.

  • health_check_arns (Array<String>, nil) (defaults to: nil)

    The ARN (Amazon Resource Name) of the health check to associate with the protection.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    Key:value pairs associated with an AWS resource.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'shield/cfn_protection_props.rb', line 14

def initialize(name:, resource_arn:, application_layer_automatic_response_configuration: nil, health_check_arns: nil, tags: nil)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @resource_arn = resource_arn
  Jsii::Type.check_type(@resource_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceArn")
  @application_layer_automatic_response_configuration = application_layer_automatic_response_configuration.is_a?(Hash) ? ::AWSCDK::Shield::CfnProtection::ApplicationLayerAutomaticResponseConfigurationProperty.new(**application_layer_automatic_response_configuration.transform_keys(&:to_sym)) : application_layer_automatic_response_configuration
  Jsii::Type.check_type(@application_layer_automatic_response_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zaGllbGQuQ2ZuUHJvdGVjdGlvbi5BcHBsaWNhdGlvbkxheWVyQXV0b21hdGljUmVzcG9uc2VDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "applicationLayerAutomaticResponseConfiguration") unless @application_layer_automatic_response_configuration.nil?
  @health_check_arns = health_check_arns
  Jsii::Type.check_type(@health_check_arns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "healthCheckArns") unless @health_check_arns.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

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

The automatic application layer DDoS mitigation settings for the protection.

This configuration determines whether Shield Advanced automatically manages rules in the web ACL in order to respond to application layer events that Shield Advanced determines to be DDoS attacks.

If you use CloudFormation to manage the web ACLs that you use with Shield Advanced automatic mitigation, see the additional guidance about web ACL management in the AWS::WAFv2::WebACL resource description.



47
48
49
# File 'shield/cfn_protection_props.rb', line 47

def application_layer_automatic_response_configuration
  @application_layer_automatic_response_configuration
end

#health_check_arnsArray<String>? (readonly)

The ARN (Amazon Resource Name) of the health check to associate with the protection.

Health-based detection provides improved responsiveness and accuracy in attack detection and mitigation.

You can use this option with any resource type except for RouteĀ 53 hosted zones.

For more information, see Configuring health-based detection using health checks in the AWS Shield Advanced Developer Guide .



58
59
60
# File 'shield/cfn_protection_props.rb', line 58

def health_check_arns
  @health_check_arns
end

#nameString (readonly)

The name of the protection. For example, My CloudFront distributions .

If you change the name of an existing protection, Shield Advanced deletes the protection and replaces it with a new one. While this is happening, the protection isn't available on the AWS resource.



33
34
35
# File 'shield/cfn_protection_props.rb', line 33

def name
  @name
end

#resource_arnString (readonly)

The ARN (Amazon Resource Name) of the AWS resource that is protected.



38
39
40
# File 'shield/cfn_protection_props.rb', line 38

def resource_arn
  @resource_arn
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.



65
66
67
# File 'shield/cfn_protection_props.rb', line 65

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



67
68
69
70
71
72
73
74
75
# File 'shield/cfn_protection_props.rb', line 67

def self.jsii_properties
  {
    :name => "name",
    :resource_arn => "resourceArn",
    :application_layer_automatic_response_configuration => "applicationLayerAutomaticResponseConfiguration",
    :health_check_arns => "healthCheckArns",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



77
78
79
80
81
82
83
84
85
86
87
# File 'shield/cfn_protection_props.rb', line 77

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "resourceArn" => @resource_arn,
    "applicationLayerAutomaticResponseConfiguration" => @application_layer_automatic_response_configuration,
    "healthCheckArns" => @health_check_arns,
    "tags" => @tags,
  })
  result.compact
end