CustomOriginConfig

class aws_cdk.aws_cloudfront.CustomOriginConfig(*, allowed_origin_ssl_versions=None, domain_name, http_port=None, https_port=None, origin_headers=None, origin_keepalive_timeout=None, origin_path=None, origin_protocol_policy=None, origin_read_timeout=None, origin_shield_region=None)

Bases: object

A custom origin configuration.

Parameters
  • allowed_origin_ssl_versions (Optional[Sequence[OriginSslPolicy]]) – The SSL versions to use when interacting with the origin. Default: OriginSslPolicy.TLS_V1_2

  • domain_name (str) – The domain name of the custom origin. Should not include the path - that should be in the parent SourceConfiguration

  • http_port (Union[int, float, None]) – The origin HTTP port. Default: 80

  • https_port (Union[int, float, None]) – The origin HTTPS port. Default: 443

  • origin_headers (Optional[Mapping[str, str]]) – Any additional headers to pass to the origin. Default: - No additional headers are passed.

  • origin_keepalive_timeout (Optional[Duration]) – The keep alive timeout when making calls in seconds. Default: Duration.seconds(5)

  • origin_path (Optional[str]) – The relative path to the origin root to use for sources. Default: /

  • origin_protocol_policy (Optional[OriginProtocolPolicy]) – The protocol (http or https) policy to use when interacting with the origin. Default: OriginProtocolPolicy.HttpsOnly

  • origin_read_timeout (Optional[Duration]) – The read timeout when calling the origin in seconds. Default: Duration.seconds(30)

  • 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

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_cloudfront as cloudfront
import aws_cdk.core as cdk

custom_origin_config = cloudfront.CustomOriginConfig(
    domain_name="domainName",

    # the properties below are optional
    allowed_origin_sSLVersions=[cloudfront.OriginSslPolicy.SSL_V3],
    http_port=123,
    https_port=123,
    origin_headers={
        "origin_headers_key": "originHeaders"
    },
    origin_keepalive_timeout=cdk.Duration.minutes(30),
    origin_path="originPath",
    origin_protocol_policy=cloudfront.OriginProtocolPolicy.HTTP_ONLY,
    origin_read_timeout=cdk.Duration.minutes(30),
    origin_shield_region="originShieldRegion"
)

Attributes

allowed_origin_ssl_versions

The SSL versions to use when interacting with the origin.

Default

OriginSslPolicy.TLS_V1_2

Return type

Optional[List[OriginSslPolicy]]

domain_name

The domain name of the custom origin.

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

Return type

str

http_port

The origin HTTP port.

Default

80

Return type

Union[int, float, None]

https_port

The origin HTTPS port.

Default

443

Return type

Union[int, float, None]

origin_headers

Any additional headers to pass to the origin.

Default
  • No additional headers are passed.

Return type

Optional[Mapping[str, str]]

origin_keepalive_timeout

The keep alive timeout when making calls in seconds.

Default

Duration.seconds(5)

Return type

Optional[Duration]

origin_path

The relative path to the origin root to use for sources.

Default

/

Return type

Optional[str]

origin_protocol_policy

The protocol (http or https) policy to use when interacting with the origin.

Default

OriginProtocolPolicy.HttpsOnly

Return type

Optional[OriginProtocolPolicy]

origin_read_timeout

The read timeout when calling the origin in seconds.

Default

Duration.seconds(30)

Return type

Optional[Duration]

origin_shield_region

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

Return type

Optional[str]