Skip to main content

CloudFrontOriginSchema

One origin the distribution can serve from.

@group

Resources/CloudFrontDistribution

Index

Properties

optionalconnectionAttempts

connectionAttempts?: number = 3

How many times CloudFront retries the origin before giving up. Between 1 and 3.

optionalconnectionTimeout

connectionTimeout?: number = 10

How long CloudFront waits to establish a connection to the origin, in seconds. Between 1 and 10.

optionalcustomHeaders

customHeaders?: {} = {}

Headers CloudFront adds to every request it sends to this origin. This is how a load balancer rejects anything that did not arrive through the distribution.


Type declaration

  • [key string]: string

kind

kind: { bucketName: string; bucketRegion: string; kind: s3 } | { kind: lambda; resourceId?: string } | { kind: alb; resourceId?: string } | { domainName: string; httpPort: number; httpsPort: number; keepaliveTimeout: number; kind: custom; originProtocolPolicy: https-only | http-only | match-viewer; readTimeout: number; sslProtocols: string[] }

What kind of origin this is, and the settings that only apply to that kind.

  • s3 is a bucket reached privately, through an origin access control the distribution creates. Read access on the bucket is granted by the bucket, not here.
  • lambda is the URL of a Lambda function, reached over HTTPS through an origin access control the distribution creates. The function admits the distribution, not this origin. resourceId is the function's, set by CloudFrontDistribution.addLambdaOrigin() when it attaches the function.
  • alb is an internet-facing ALB, reached over HTTP on port 80, the only listener octo's ALB has. resourceId is the ALB's, set by CloudFrontDistribution.addAlbOrigin() when it attaches the ALB.
  • custom is a hostname octo does not manage - a legacy origin, or a third party.

originId

originId: string

A name you choose for this origin, e.g. website. Behaviors and origin groups refer to it. Unique across origins and origin groups.

optionaloriginPath

originPath?: string = ''

A prefix CloudFront prepends to the path before asking the origin for it. Empty asks the origin for the path the viewer requested.