Class: AWSCDK::CloudFrontOrigins::VPCOriginProps

Inherits:
AWSCDK::CloudFront::OriginProps
  • Object
show all
Defined in:
cloud_front_origins/vpc_origin_props.rb

Overview

Properties to define a VPC origin.

Direct Known Subclasses

VPCOriginWithEndpointProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, domain_name: nil, keepalive_timeout: nil, read_timeout: nil) ⇒ VPCOriginProps

Returns a new instance of VPCOriginProps.

Parameters:

  • connection_attempts (Numeric, nil) (defaults to: nil)

    The number of times that CloudFront attempts to connect to the origin;

  • connection_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    The number of seconds that CloudFront waits when trying to establish a connection to the origin.

  • custom_headers (Hash{String => String}, nil) (defaults to: nil)

    A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.

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

    The unique identifier of an origin access control for this origin.

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

    A unique identifier for the origin.

  • origin_shield_enabled (Boolean, nil) (defaults to: nil)

    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, nil) (defaults to: nil)

    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, nil) (defaults to: nil)

    The time that a request from CloudFront to the origin can stay open and wait for a response.

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

    An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.

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

    The domain name associated with your VPC origin.

  • keepalive_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    Specifies how long, in seconds, CloudFront persists its connection to the origin.

  • read_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    Specifies how long, in seconds, CloudFront waits for a response from the origin, also known as the origin response timeout.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'cloud_front_origins/vpc_origin_props.rb', line 19

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, domain_name: nil, keepalive_timeout: nil, read_timeout: 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?
  @domain_name = domain_name
  Jsii::Type.check_type(@domain_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "domainName") unless @domain_name.nil?
  @keepalive_timeout = keepalive_timeout
  Jsii::Type.check_type(@keepalive_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "keepaliveTimeout") unless @keepalive_timeout.nil?
  @read_timeout = read_timeout
  Jsii::Type.check_type(@read_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "readTimeout") unless @read_timeout.nil?
end

Instance Attribute Details

#connection_attemptsNumeric? (readonly)

Note:

Default: 3

The number of times that CloudFront attempts to connect to the origin;

valid values are 1, 2, or 3 attempts.

Returns:

  • (Numeric, nil)


52
53
54
# File 'cloud_front_origins/vpc_origin_props.rb', line 52

def connection_attempts
  @connection_attempts
end

#connection_timeoutAWSCDK::Duration? (readonly)

Note:

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.

Returns:



59
60
61
# File 'cloud_front_origins/vpc_origin_props.rb', line 59

def connection_timeout
  @connection_timeout
end

#custom_headersHash{String => String}? (readonly)

Note:

Default: {}

A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.

Returns:

  • (Hash{String => String}, nil)


64
65
66
# File 'cloud_front_origins/vpc_origin_props.rb', line 64

def custom_headers
  @custom_headers
end

#domain_nameString? (readonly)

Note:

Default: - The default domain name of the endpoint.

The domain name associated with your VPC origin.

Returns:

  • (String, nil)


109
110
111
# File 'cloud_front_origins/vpc_origin_props.rb', line 109

def domain_name
  @domain_name
end

#keepalive_timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(5)

Specifies how long, in seconds, CloudFront persists its connection to the origin.

The valid range is from 1 to 180 seconds, inclusive.

Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time.

Returns:



119
120
121
# File 'cloud_front_origins/vpc_origin_props.rb', line 119

def keepalive_timeout
  @keepalive_timeout
end

#origin_access_control_idString? (readonly)

Note:

Default: - no origin access control

The unique identifier of an origin access control for this origin.

Returns:

  • (String, nil)


69
70
71
# File 'cloud_front_origins/vpc_origin_props.rb', line 69

def origin_access_control_id
  @origin_access_control_id
end

#origin_idString? (readonly)

Note:

Default: - an originid will be generated for you

A unique identifier for the origin.

This value must be unique within the distribution.

Returns:

  • (String, nil)


76
77
78
# File 'cloud_front_origins/vpc_origin_props.rb', line 76

def origin_id
  @origin_id
end

#origin_pathString? (readonly)

Note:

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').

Returns:

  • (String, nil)


104
105
106
# File 'cloud_front_origins/vpc_origin_props.rb', line 104

def origin_path
  @origin_path
end

#origin_shield_enabledBoolean? (readonly)

Note:

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.

Returns:

  • (Boolean, nil)


81
82
83
# File 'cloud_front_origins/vpc_origin_props.rb', line 81

def origin_shield_enabled
  @origin_shield_enabled
end

#origin_shield_regionString? (readonly)

Note:

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.



87
88
89
# File 'cloud_front_origins/vpc_origin_props.rb', line 87

def origin_shield_region
  @origin_shield_region
end

#read_timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(30)

Specifies how long, in seconds, CloudFront waits for a response from the origin, also known as the origin response timeout.

The valid range is from 1 to 180 seconds, inclusive.

Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time.

Returns:



129
130
131
# File 'cloud_front_origins/vpc_origin_props.rb', line 129

def read_timeout
  @read_timeout
end

#response_completion_timeoutAWSCDK::Duration? (readonly)

Note:

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.



97
98
99
# File 'cloud_front_origins/vpc_origin_props.rb', line 97

def response_completion_timeout
  @response_completion_timeout
end

Class Method Details

.jsii_propertiesObject



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'cloud_front_origins/vpc_origin_props.rb', line 131

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",
    :domain_name => "domainName",
    :keepalive_timeout => "keepaliveTimeout",
    :read_timeout => "readTimeout",
  }
end

Instance Method Details

#to_jsiiObject



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'cloud_front_origins/vpc_origin_props.rb', line 148

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,
    "domainName" => @domain_name,
    "keepaliveTimeout" => @keepalive_timeout,
    "readTimeout" => @read_timeout,
  })
  result.compact
end