Skip to content
v2.274.0

OriginOptions Struct ​

Options to define an Origin.

Example ​

ts
// 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';
const originOptions: cloudfront.OriginOptions = {
  connectionAttempts: 123,
  connectionTimeout: cdk.Duration.minutes(30),
  customHeaders: {
    customHeadersKey: 'customHeaders',
  },
  originAccessControlId: 'originAccessControlId',
  originId: 'originId',
  originShieldEnabled: false,
  originShieldRegion: 'originShieldRegion',
  responseCompletionTimeout: cdk.Duration.minutes(30),
};

Properties ​

connectionAttemptsnumberconnection_attemptsint | floatconnectionAttemptsNumberConnectionAttemptsdoubleConnectionAttempts*float64= 3#
The number of times that CloudFront attempts to connect to the origin;

valid values are 1, 2, or 3 attempts.

connectionTimeoutDurationconnection_timeoutDurationconnectionTimeoutDurationConnectionTimeoutDurationConnectionTimeoutDuration= 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{ [key: string]: string }custom_headerstyping.Mapping[str, str]customHeadersMap<String, String>CustomHeadersIDictionary<string, string>CustomHeaders*map[string]*string= {}#
A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
originAccessControlIdstringorigin_access_control_idstroriginAccessControlIdStringOriginAccessControlIdstringOriginAccessControlId*string= no origin access control#
The unique identifier of an origin access control for this origin.
originIdstringorigin_idstroriginIdStringOriginIdstringOriginId*string= an originid will be generated fo…#
A unique identifier for the origin.

This value must be unique within the distribution.

default

Default: an originid will be generated for you

originShieldEnabledbooleanorigin_shield_enabledbooloriginShieldEnabledBooleanOriginShieldEnabledboolOriginShieldEnabled*bool= 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.
originShieldRegionstringorigin_shield_regionstroriginShieldRegionStringOriginShieldRegionstringOriginShieldRegion*string= 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.
responseCompletionTimeoutDurationresponse_completion_timeoutDurationresponseCompletionTimeoutDurationResponseCompletionTimeoutDurationResponseCompletionTimeoutDuration= undefined - AWS CloudFront defau…#
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.

default

Default: undefined - AWS CloudFront default is not enforcing a maximum value