HttpOrigin

class aws_cdk.aws_cloudfront_origins.HttpOrigin(domain_name, *, http_port=None, https_port=None, keepalive_timeout=None, protocol_policy=None, read_timeout=None, connection_attempts=None, connection_timeout=None, custom_headers=None, origin_path=None)

Bases: aws_cdk.aws_cloudfront.OriginBase

(experimental) An Origin for an HTTP server or S3 bucket configured for website hosting.

Stability

experimental

Parameters
  • domain_name (str) –

  • http_port (Union[int, float, None]) – (experimental) The HTTP port that CloudFront uses to connect to the origin. Default: 80

  • https_port (Union[int, float, None]) – (experimental) The HTTPS port that CloudFront uses to connect to the origin. Default: 443

  • keepalive_timeout (Optional[Duration]) – (experimental) Specifies how long, in seconds, CloudFront persists its connection to the origin. The valid range is from 1 to 60 seconds, inclusive. Default: Duration.seconds(5)

  • protocol_policy (Optional[OriginProtocolPolicy]) – (experimental) Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin. Default: OriginProtocolPolicy.HTTPS_ONLY

  • read_timeout (Optional[Duration]) – (experimental) 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 60 seconds, inclusive. Default: Duration.seconds(30)

  • connection_attempts (Union[int, float, None]) – (experimental) The number of times that CloudFront attempts to connect to the origin; valid values are 1, 2, or 3 attempts. Default: 3

  • connection_timeout (Optional[Duration]) – (experimental) 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]]) – (experimental) A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. Default: {}

  • origin_path (Optional[str]) – (experimental) 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: ‘/’

Stability

experimental

Methods

bind(_scope, *, origin_id)

(experimental) Binds the origin to the associated Distribution.

Can be used to grant permissions, create dependent resources, etc.

Parameters
  • _scope (Construct) –

  • origin_id (str) – (experimental) The identifier of this Origin, as assigned by the Distribution this Origin has been used added to.

Stability

experimental

Return type

OriginBindConfig