Class: AWSCDK::CloudFront::S3OriginConfig
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudFront::S3OriginConfig
- Defined in:
- cloud_front/s3_origin_config.rb
Overview
S3 origin configuration for CloudFront.
Instance Attribute Summary collapse
-
#origin_access_identity ⇒ Object?
readonly
The optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket.
-
#origin_headers ⇒ Hash{String => String}?
readonly
Any additional headers to pass to the origin.
-
#origin_path ⇒ String?
readonly
The relative path to the origin root to use for sources.
-
#origin_shield_region ⇒ String?
readonly
When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
-
#s3_bucket_source ⇒ AWSCDK::S3::IBucket
readonly
The source bucket to serve content from.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(s3_bucket_source:, origin_access_identity: nil, origin_headers: nil, origin_path: nil, origin_shield_region: nil) ⇒ S3OriginConfig
constructor
A new instance of S3OriginConfig.
- #to_jsii ⇒ Object
Constructor Details
#initialize(s3_bucket_source:, origin_access_identity: nil, origin_headers: nil, origin_path: nil, origin_shield_region: nil) ⇒ S3OriginConfig
Returns a new instance of S3OriginConfig.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'cloud_front/s3_origin_config.rb', line 12 def initialize(s3_bucket_source:, origin_access_identity: nil, origin_headers: nil, origin_path: nil, origin_shield_region: nil) @s3_bucket_source = s3_bucket_source Jsii::Type.check_type(@s3_bucket_source, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "s3BucketSource") @origin_access_identity = origin_access_identity Jsii::Type.check_type(@origin_access_identity, JSON.parse(Base64.strict_decode64("eyJpbnRlcnNlY3Rpb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX2Nsb3VkZnJvbnQuSUNsb3VkRnJvbnRPcmlnaW5BY2Nlc3NJZGVudGl0eVJlZiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuYXdzX2lhbS5JR3JhbnRhYmxlIn1dfX0=")), "originAccessIdentity") unless @origin_access_identity.nil? @origin_headers = origin_headers Jsii::Type.check_type(@origin_headers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "originHeaders") unless @origin_headers.nil? @origin_path = origin_path Jsii::Type.check_type(@origin_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "originPath") unless @origin_path.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
#origin_access_identity ⇒ Object? (readonly)
Default: No Origin Access Identity which requires the S3 bucket to be public accessible
The optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket.
33 34 35 |
# File 'cloud_front/s3_origin_config.rb', line 33 def origin_access_identity @origin_access_identity end |
#origin_headers ⇒ Hash{String => String}? (readonly)
Default: - No additional headers are passed.
Any additional headers to pass to the origin.
38 39 40 |
# File 'cloud_front/s3_origin_config.rb', line 38 def origin_headers @origin_headers end |
#origin_path ⇒ String? (readonly)
Default: /
The relative path to the origin root to use for sources.
43 44 45 |
# File 'cloud_front/s3_origin_config.rb', line 43 def origin_path @origin_path end |
#origin_shield_region ⇒ String? (readonly)
Default: - origin shield not enabled
When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
48 49 50 |
# File 'cloud_front/s3_origin_config.rb', line 48 def origin_shield_region @origin_shield_region end |
#s3_bucket_source ⇒ AWSCDK::S3::IBucket (readonly)
The source bucket to serve content from.
28 29 30 |
# File 'cloud_front/s3_origin_config.rb', line 28 def s3_bucket_source @s3_bucket_source end |
Class Method Details
.jsii_properties ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'cloud_front/s3_origin_config.rb', line 50 def self.jsii_properties { :s3_bucket_source => "s3BucketSource", :origin_access_identity => "originAccessIdentity", :origin_headers => "originHeaders", :origin_path => "originPath", :origin_shield_region => "originShieldRegion", } end |
Instance Method Details
#to_jsii ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 |
# File 'cloud_front/s3_origin_config.rb', line 60 def to_jsii result = {} result.merge!({ "s3BucketSource" => @s3_bucket_source, "originAccessIdentity" => @origin_access_identity, "originHeaders" => @origin_headers, "originPath" => @origin_path, "originShieldRegion" => @origin_shield_region, }) result.compact end |