Class: AWSCDK::CloudFront::CfnDistribution::S3OriginConfigProperty

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

Overview

A complex type that contains information about the Amazon S3 origin.

If the origin is a custom origin or an S3 bucket that is configured as a website endpoint, use the CustomOriginConfig element instead.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(origin_access_identity: nil, origin_read_timeout: nil) ⇒ S3OriginConfigProperty

Returns a new instance of S3OriginConfigProperty.

Parameters:

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

    If you're using origin access control (OAC) instead of origin access identity, specify an empty OriginAccessIdentity element.

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

    Specifies how long, in seconds, CloudFront waits for a response from the origin.



3121
3122
3123
3124
3125
3126
# File 'cloud_front/cfn_distribution.rb', line 3121

def initialize(origin_access_identity: nil, origin_read_timeout: nil)
  @origin_access_identity = origin_access_identity
  Jsii::Type.check_type(@origin_access_identity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "originAccessIdentity") unless @origin_access_identity.nil?
  @origin_read_timeout = origin_read_timeout
  Jsii::Type.check_type(@origin_read_timeout, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "originReadTimeout") unless @origin_read_timeout.nil?
end

Instance Attribute Details

#origin_access_identityString? (readonly)

Note:

Default: - ""

If you're using origin access control (OAC) instead of origin access identity, specify an empty OriginAccessIdentity element.

For more information, see Restricting access to an AWS in the Amazon CloudFront Developer Guide .

The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is:

origin-access-identity/cloudfront/ID-of-origin-access-identity

The *ID-of-origin-access-identity* is the value that CloudFront returned in the ID element when you created the origin access identity.

If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element.

To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty OriginAccessIdentity element.

To replace the origin access identity, update the distribution configuration and specify the new origin access identity.

For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide .



3149
3150
3151
# File 'cloud_front/cfn_distribution.rb', line 3149

def origin_access_identity
  @origin_access_identity
end

#origin_read_timeoutNumeric? (readonly)

Note:

Default: - 30

Specifies how long, in seconds, CloudFront waits for a response from the origin.

This is also known as the origin response timeout . The minimum timeout is 1 second, the maximum is 120 seconds, and the default (if you don't specify otherwise) is 30 seconds.

For more information, see Response timeout in the Amazon CloudFront Developer Guide .



3159
3160
3161
# File 'cloud_front/cfn_distribution.rb', line 3159

def origin_read_timeout
  @origin_read_timeout
end

Class Method Details

.jsii_propertiesObject



3161
3162
3163
3164
3165
3166
# File 'cloud_front/cfn_distribution.rb', line 3161

def self.jsii_properties
  {
    :origin_access_identity => "originAccessIdentity",
    :origin_read_timeout => "originReadTimeout",
  }
end

Instance Method Details

#to_jsiiObject



3168
3169
3170
3171
3172
3173
3174
3175
# File 'cloud_front/cfn_distribution.rb', line 3168

def to_jsii
  result = {}
  result.merge!({
    "originAccessIdentity" => @origin_access_identity,
    "originReadTimeout" => @origin_read_timeout,
  })
  result.compact
end