Class: AWSCDK::CloudFrontOrigins::S3BucketOriginWithOACProps
- Inherits:
-
S3BucketOriginBaseProps
- Object
- S3BucketOriginBaseProps
- AWSCDK::CloudFrontOrigins::S3BucketOriginWithOACProps
- Defined in:
- cloud_front_origins/s3_bucket_origin_with_oac_props.rb
Overview
Properties for configuring a S3 origin with OAC.
Instance Attribute Summary collapse
-
#connection_attempts ⇒ Numeric?
readonly
The number of times that CloudFront attempts to connect to the origin;.
-
#connection_timeout ⇒ AWSCDK::Duration?
readonly
The number of seconds that CloudFront waits when trying to establish a connection to the origin.
-
#custom_headers ⇒ Hash{String => String}?
readonly
A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
-
#origin_access_control ⇒ AWSCDK::Interfaces::AWSCloudfront::IOriginAccessControlRef?
readonly
An optional Origin Access Control.
-
#origin_access_control_id ⇒ String?
readonly
The unique identifier of an origin access control for this origin.
-
#origin_access_levels ⇒ Array<AWSCDK::CloudFront::AccessLevel>?
readonly
The level of permissions granted in the bucket policy and key policy (if applicable) to the CloudFront distribution.
-
#origin_id ⇒ String?
readonly
A unique identifier for the origin.
-
#origin_path ⇒ String?
readonly
An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
-
#origin_shield_enabled ⇒ Boolean?
readonly
Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false.
-
#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.
-
#response_completion_timeout ⇒ AWSCDK::Duration?
readonly
The time that a request from CloudFront to the origin can stay open and wait for a response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(connection_attempts: nil, connection_timeout: nil, custom_headers: nil, origin_access_control_id: nil, origin_id: nil, origin_shield_enabled: nil, origin_shield_region: nil, response_completion_timeout: nil, origin_path: nil, origin_access_control: nil, origin_access_levels: nil) ⇒ S3BucketOriginWithOACProps
constructor
A new instance of S3BucketOriginWithOACProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(connection_attempts: nil, connection_timeout: nil, custom_headers: nil, origin_access_control_id: nil, origin_id: nil, origin_shield_enabled: nil, origin_shield_region: nil, response_completion_timeout: nil, origin_path: nil, origin_access_control: nil, origin_access_levels: nil) ⇒ S3BucketOriginWithOACProps
Returns a new instance of S3BucketOriginWithOACProps.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 18 def initialize(connection_attempts: nil, connection_timeout: nil, custom_headers: nil, origin_access_control_id: nil, origin_id: nil, origin_shield_enabled: nil, origin_shield_region: nil, response_completion_timeout: nil, origin_path: nil, origin_access_control: nil, origin_access_levels: nil) @connection_attempts = connection_attempts Jsii::Type.check_type(@connection_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "connectionAttempts") unless @connection_attempts.nil? @connection_timeout = connection_timeout Jsii::Type.check_type(@connection_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "connectionTimeout") unless @connection_timeout.nil? @custom_headers = custom_headers Jsii::Type.check_type(@custom_headers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "customHeaders") unless @custom_headers.nil? @origin_access_control_id = origin_access_control_id Jsii::Type.check_type(@origin_access_control_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "originAccessControlId") unless @origin_access_control_id.nil? @origin_id = origin_id Jsii::Type.check_type(@origin_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "originId") unless @origin_id.nil? @origin_shield_enabled = origin_shield_enabled Jsii::Type.check_type(@origin_shield_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "originShieldEnabled") unless @origin_shield_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? @response_completion_timeout = response_completion_timeout Jsii::Type.check_type(@response_completion_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "responseCompletionTimeout") unless @response_completion_timeout.nil? @origin_path = origin_path Jsii::Type.check_type(@origin_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "originPath") unless @origin_path.nil? @origin_access_control = origin_access_control Jsii::Type.check_type(@origin_access_control, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19jbG91ZGZyb250LklPcmlnaW5BY2Nlc3NDb250cm9sUmVmIn0=")), "originAccessControl") unless @origin_access_control.nil? @origin_access_levels = origin_access_levels Jsii::Type.check_type(@origin_access_levels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkFjY2Vzc0xldmVsIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "originAccessLevels") unless @origin_access_levels.nil? end |
Instance Attribute Details
#connection_attempts ⇒ Numeric? (readonly)
Default: 3
The number of times that CloudFront attempts to connect to the origin;
valid values are 1, 2, or 3 attempts.
49 50 51 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 49 def connection_attempts @connection_attempts end |
#connection_timeout ⇒ AWSCDK::Duration? (readonly)
Default: Duration.seconds(10)
The number of seconds that CloudFront waits when trying to establish a connection to the origin.
Valid values are 1-10 seconds, inclusive.
56 57 58 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 56 def connection_timeout @connection_timeout end |
#custom_headers ⇒ Hash{String => String}? (readonly)
Default: {}
A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
61 62 63 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 61 def custom_headers @custom_headers end |
#origin_access_control ⇒ AWSCDK::Interfaces::AWSCloudfront::IOriginAccessControlRef? (readonly)
Default: - an Origin Access Control will be created.
An optional Origin Access Control.
106 107 108 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 106 def origin_access_control @origin_access_control end |
#origin_access_control_id ⇒ String? (readonly)
Default: - no origin access control
The unique identifier of an origin access control for this origin.
66 67 68 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 66 def origin_access_control_id @origin_access_control_id end |
#origin_access_levels ⇒ Array<AWSCDK::CloudFront::AccessLevel>? (readonly)
Default: [AccessLevel.READ]
The level of permissions granted in the bucket policy and key policy (if applicable) to the CloudFront distribution.
111 112 113 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 111 def origin_access_levels @origin_access_levels end |
#origin_id ⇒ String? (readonly)
Default: - an originid will be generated for you
A unique identifier for the origin.
This value must be unique within the distribution.
73 74 75 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 73 def origin_id @origin_id end |
#origin_path ⇒ String? (readonly)
Default: '/'
An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
Must begin, but not end, with '/' (e.g., '/production/images').
101 102 103 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 101 def origin_path @origin_path end |
#origin_shield_enabled ⇒ Boolean? (readonly)
Default: - true
Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false.
78 79 80 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 78 def origin_shield_enabled @origin_shield_enabled 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.
84 85 86 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 84 def origin_shield_region @origin_shield_region end |
#response_completion_timeout ⇒ AWSCDK::Duration? (readonly)
Default: undefined - AWS CloudFront default is not enforcing a maximum value
The time that a request from CloudFront to the origin can stay open and wait for a response.
If the complete response isn't received from the origin by this time, CloudFront ends the connection.
Valid values are 1-3600 seconds, inclusive.
94 95 96 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 94 def response_completion_timeout @response_completion_timeout end |
Class Method Details
.jsii_properties ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 113 def self.jsii_properties { :connection_attempts => "connectionAttempts", :connection_timeout => "connectionTimeout", :custom_headers => "customHeaders", :origin_access_control_id => "originAccessControlId", :origin_id => "originId", :origin_shield_enabled => "originShieldEnabled", :origin_shield_region => "originShieldRegion", :response_completion_timeout => "responseCompletionTimeout", :origin_path => "originPath", :origin_access_control => "originAccessControl", :origin_access_levels => "originAccessLevels", } end |
Instance Method Details
#to_jsii ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'cloud_front_origins/s3_bucket_origin_with_oac_props.rb', line 129 def to_jsii result = {} result.merge!(super) result.merge!({ "connectionAttempts" => @connection_attempts, "connectionTimeout" => @connection_timeout, "customHeaders" => @custom_headers, "originAccessControlId" => @origin_access_control_id, "originId" => @origin_id, "originShieldEnabled" => @origin_shield_enabled, "originShieldRegion" => @origin_shield_region, "responseCompletionTimeout" => @response_completion_timeout, "originPath" => @origin_path, "originAccessControl" => @origin_access_control, "originAccessLevels" => @origin_access_levels, }) result.compact end |