HttpOrigin
- class aws_cdk.aws_cloudfront_origins.HttpOrigin(domain_name, *, http_port=None, https_port=None, keepalive_timeout=None, origin_ssl_protocols=None, protocol_policy=None, read_timeout=None, origin_path=None, connection_attempts=None, connection_timeout=None, custom_headers=None, origin_shield_region=None)
Bases:
OriginBase
An Origin for an HTTP server or S3 bucket configured for website hosting.
- ExampleMetadata:
infused
Example:
my_bucket = s3.Bucket(self, "myBucket") cloudfront.Distribution(self, "myDist", default_behavior=cloudfront.BehaviorOptions( origin=origins.OriginGroup( primary_origin=origins.S3Origin(my_bucket), fallback_origin=origins.HttpOrigin("www.example.com"), # optional, defaults to: 500, 502, 503 and 504 fallback_status_codes=[404] ) ) )
- Parameters:
domain_name (
str
) –http_port (
Union
[int
,float
,None
]) – The HTTP port that CloudFront uses to connect to the origin. Default: 80https_port (
Union
[int
,float
,None
]) – The HTTPS port that CloudFront uses to connect to the origin. Default: 443keepalive_timeout (
Optional
[Duration
]) – 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. Default: Duration.seconds(5)origin_ssl_protocols (
Optional
[Sequence
[OriginSslPolicy
]]) – The SSL versions to use when interacting with the origin. Default: OriginSslPolicy.TLS_V1_2protocol_policy (
Optional
[OriginProtocolPolicy
]) – Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin. Default: OriginProtocolPolicy.HTTPS_ONLYread_timeout (
Optional
[Duration
]) – 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. Default: Duration.seconds(30)origin_path (
Optional
[str
]) – 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’). Default: ‘/’connection_attempts (
Union
[int
,float
,None
]) – The number of times that CloudFront attempts to connect to the origin; valid values are 1, 2, or 3 attempts. Default: 3connection_timeout (
Optional
[Duration
]) – The number of seconds that CloudFront waits when trying to establish a connection to the origin. Valid values are 1-10 seconds, inclusive. Default: Duration.seconds(10)custom_headers (
Optional
[Mapping
[str
,str
]]) – A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. Default: {}origin_shield_region (
Optional
[str
]) – 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
Methods
- bind(_scope, *, origin_id)
Binds the origin to the associated Distribution.
Can be used to grant permissions, create dependent resources, etc.
- Parameters:
_scope (
Construct
) –origin_id (
str
) – The identifier of this Origin, as assigned by the Distribution this Origin has been used added to.
- Return type: