interface RestApiOriginProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudFront.Origins.RestApiOriginProps |
![]() | software.amazon.awscdk.services.cloudfront.origins.RestApiOriginProps |
![]() | aws_cdk.aws_cloudfront_origins.RestApiOriginProps |
![]() | @aws-cdk/aws-cloudfront-origins » RestApiOriginProps |
Properties for an Origin for an API Gateway REST API.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cloudfront_origins from '@aws-cdk/aws-cloudfront-origins';
import * as cdk from '@aws-cdk/core';
const restApiOriginProps: cloudfront_origins.RestApiOriginProps = {
connectionAttempts: 123,
connectionTimeout: cdk.Duration.minutes(30),
customHeaders: {
customHeadersKey: 'customHeaders',
},
keepaliveTimeout: cdk.Duration.minutes(30),
originShieldRegion: 'originShieldRegion',
readTimeout: 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. |
keepalive | Duration | Specifies how long, in seconds, CloudFront persists its connection to the origin. |
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. |
read | Duration | Specifies how long, in seconds, CloudFront waits for a response from the origin, also known as the origin response timeout. |
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.
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.
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.
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.