Class: AWSCDK::CloudFront::CfnDistribution::OriginShieldProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_front/cfn_distribution.rb

Overview

CloudFront Origin Shield.

Using Origin Shield can help reduce the load on your origin. For more information, see Using Origin Shield in the Amazon CloudFront Developer Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled: nil, origin_shield_region: nil) ⇒ OriginShieldProperty

Returns a new instance of OriginShieldProperty.

Parameters:

  • enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    A flag that specifies whether Origin Shield is enabled.

  • origin_shield_region (String, nil) (defaults to: nil)

    The AWS Region for Origin Shield.



2990
2991
2992
2993
2994
2995
# File 'cloud_front/cfn_distribution.rb', line 2990

def initialize(enabled: nil, origin_shield_region: nil)
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enabled") unless @enabled.nil?
  @origin_shield_region = origin_shield_region
  Jsii::Type.check_type(@origin_shield_region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "originShieldRegion") unless @origin_shield_region.nil?
end

Instance Attribute Details

#enabledBoolean, ... (readonly)

A flag that specifies whether Origin Shield is enabled.

When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your origin. When it's disabled, CloudFront might send requests directly to your origin from multiple edge locations or regional edge caches.



3003
3004
3005
# File 'cloud_front/cfn_distribution.rb', line 3003

def enabled
  @enabled
end

#origin_shield_regionString? (readonly)

The AWS Region for Origin Shield.

Specify the AWS Region that has the lowest latency to your origin. To specify a region, use the region code, not the region name. For example, specify the US East (Ohio) region as us-east-2 .

When you enable CloudFront Origin Shield, you must specify the AWS Region for Origin Shield. For the list of AWS Regions that you can specify, and for help choosing the best Region for your origin, see Choosing the AWS Region for Origin Shield in the Amazon CloudFront Developer Guide .



3012
3013
3014
# File 'cloud_front/cfn_distribution.rb', line 3012

def origin_shield_region
  @origin_shield_region
end

Class Method Details

.jsii_propertiesObject



3014
3015
3016
3017
3018
3019
# File 'cloud_front/cfn_distribution.rb', line 3014

def self.jsii_properties
  {
    :enabled => "enabled",
    :origin_shield_region => "originShieldRegion",
  }
end

Instance Method Details

#to_jsiiObject



3021
3022
3023
3024
3025
3026
3027
3028
# File 'cloud_front/cfn_distribution.rb', line 3021

def to_jsii
  result = {}
  result.merge!({
    "enabled" => @enabled,
    "originShieldRegion" => @origin_shield_region,
  })
  result.compact
end