# CustomOriginConfig

A custom origin configuration.

- Source: [`aws-cloudfront/lib/web-distribution.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cloudfront/lib/web-distribution.ts#L235)

## Example

```ts
declare const sourceBucket: s3.Bucket;
declare const oai: cloudfront.OriginAccessIdentity;

new cloudfront.CloudFrontWebDistribution(this, 'MyCfWebDistribution', {
  originConfigs: [
    {
      s3OriginSource: {
        s3BucketSource: sourceBucket,
        originAccessIdentity: oai,
      },
      behaviors: [ {isDefaultBehavior: true}],
    },
    {
      customOriginSource: {
        domainName: 'MYALIAS',
      },
      behaviors: [{ pathPattern: '/somewhere' }]
    }
  ],
});
```

## Properties

- `allowedOriginSSLVersions`: [OriginSslPolicy](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.OriginSslPolicy.html)[] = OriginSslPolicy.TLS_V1_2 — The SSL versions to use when interacting with the origin.

- `domainName`: string (required) — The domain name of the custom origin.

  Should not include the path - that should be in the parent SourceConfiguration

- `httpPort`: number = 80 — The origin HTTP port.

- `httpsPort`: number = 443 — The origin HTTPS port.

- `originHeaders`: { [key: string]: string } — Any additional headers to pass to the origin.

  **Default:** No additional headers are passed.

- `originKeepaliveTimeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.seconds(5) — The keep alive timeout when making calls in seconds.

- `originPath`: string = / — The relative path to the origin root to use for sources.

- `originProtocolPolicy`: [OriginProtocolPolicy](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.OriginProtocolPolicy.html) = OriginProtocolPolicy.HttpsOnly — The protocol (http or https) policy to use when interacting with the origin.

- `originReadTimeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.seconds(30) — The read timeout when calling the origin in seconds.

- `originShieldRegion`: string — When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.

  **Default:** origin shield not enabled
