interface S3StaticWebsiteOriginProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudFront.Origins.S3StaticWebsiteOriginProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfrontorigins#S3StaticWebsiteOriginProps |
![]() | software.amazon.awscdk.services.cloudfront.origins.S3StaticWebsiteOriginProps |
![]() | aws_cdk.aws_cloudfront_origins.S3StaticWebsiteOriginProps |
![]() | aws-cdk-lib » aws_cloudfront_origins » S3StaticWebsiteOriginProps |
Properties for configuring a origin using a S3 bucket configured as a website endpoint.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
import { aws_cloudfront_origins as cloudfront_origins } from 'aws-cdk-lib';
const s3StaticWebsiteOriginProps: cloudfront_origins.S3StaticWebsiteOriginProps = {
connectionAttempts: 123,
connectionTimeout: cdk.Duration.minutes(30),
customHeaders: {
customHeadersKey: 'customHeaders',
},
httpPort: 123,
httpsPort: 123,
ipAddressType: cloudfront.OriginIpAddressType.IPV4,
keepaliveTimeout: cdk.Duration.minutes(30),
originAccessControlId: 'originAccessControlId',
originId: 'originId',
originPath: 'originPath',
originShieldEnabled: false,
originShieldRegion: 'originShieldRegion',
originSslProtocols: [cloudfront.OriginSslPolicy.SSL_V3],
protocolPolicy: cloudfront.OriginProtocolPolicy.HTTP_ONLY,
readTimeout: cdk.Duration.minutes(30),
responseCompletionTimeout: cdk.Duration.minutes(30),
};
Properties
Name | Type | Description |
---|---|---|
connection | number | The number of times that CloudFront attempts to connect to the origin; |
connection | Duration | The number of seconds that CloudFront waits when trying to establish a connection to the origin. |
custom | { [string]: string } | A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. |
http | number | The HTTP port that CloudFront uses to connect to the origin. |
https | number | The HTTPS port that CloudFront uses to connect to the origin. |
ip | Origin | Specifies which IP protocol CloudFront uses when connecting to your origin. |
keepalive | Duration | Specifies how long, in seconds, CloudFront persists its connection to the origin. |
origin | string | The unique identifier of an origin access control for this origin. |
origin | string | A unique identifier for the origin. |
origin | string | An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin. |
origin | boolean | 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 | string | When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance. |
origin | Origin [] | The SSL versions to use when interacting with the origin. |
protocol | Origin | Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin. |
read | Duration | Specifies how long, in seconds, CloudFront waits for a response from the origin, also known as the origin response timeout. |
response | Duration | The time that a request from CloudFront to the origin can stay open and wait for a response. |
connectionAttempts?
Type:
number
(optional, default: 3)
The number of times that CloudFront attempts to connect to the origin;
valid values are 1, 2, or 3 attempts.
connectionTimeout?
Type:
Duration
(optional, 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.
customHeaders?
Type:
{ [string]: string }
(optional, default: {})
A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
httpPort?
Type:
number
(optional, default: 80)
The HTTP port that CloudFront uses to connect to the origin.
httpsPort?
Type:
number
(optional, default: 443)
The HTTPS port that CloudFront uses to connect to the origin.
ipAddressType?
Type:
Origin
(optional, default: undefined - AWS Cloudfront default is IPv4)
Specifies which IP protocol CloudFront uses when connecting to your origin.
If your origin uses both IPv4 and IPv6 protocols, you can choose dualstack to help optimize reliability.
keepaliveTimeout?
Type:
Duration
(optional, 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.
originAccessControlId?
Type:
string
(optional, default: no origin access control)
The unique identifier of an origin access control for this origin.
originId?
Type:
string
(optional, default: an originid will be generated for you)
A unique identifier for the origin.
This value must be unique within the distribution.
originPath?
Type:
string
(optional, 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').
originShieldEnabled?
Type:
boolean
(optional, 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.
originShieldRegion?
Type:
string
(optional, 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.
See also: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html
originSslProtocols?
Type:
Origin
[]
(optional, default: OriginSslPolicy.TLS_V1_2)
The SSL versions to use when interacting with the origin.
protocolPolicy?
Type:
Origin
(optional, default: OriginProtocolPolicy.HTTPS_ONLY)
Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin.
readTimeout?
Type:
Duration
(optional, 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.
responseCompletionTimeout?
Type:
Duration
(optional, 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.