SourceConfiguration¶
-
class
aws_cdk.aws_cloudfront.
SourceConfiguration
(*, behaviors, connection_attempts=None, connection_timeout=None, custom_origin_source=None, failover_criteria_status_codes=None, failover_custom_origin_source=None, failover_s3_origin_source=None, origin_headers=None, origin_path=None, s3_origin_source=None)¶ Bases:
object
A source configuration is a wrapper for CloudFront origins and behaviors.
An origin is what CloudFront will “be in front of” - that is, CloudFront will pull it’s assets from an origin.
If you’re using s3 as a source - pass the
s3Origin
property, otherwise, pass thecustomOriginSource
property.One or the other must be passed, and it is invalid to pass both in the same SourceConfiguration.
- Parameters
behaviors (
List
[Behavior
]) – The behaviors associated with this source. At least one (default) behavior must be included.connection_attempts (
Union
[int
,float
,None
]) – The number of times that CloudFront attempts to connect to the origin. You can specify 1, 2, or 3 as the number of attempts. Default: 3connection_timeout (
Optional
[Duration
]) – The number of seconds that CloudFront waits when trying to establish a connection to the origin. You can specify a number of seconds between 1 and 10 (inclusive). Default: cdk.Duration.seconds(10)custom_origin_source (
Optional
[CustomOriginConfig
]) – A custom origin source - for all non-s3 sources.failover_criteria_status_codes (
Optional
[List
[FailoverStatusCode
]]) – HTTP status code to failover to second origin. Default: [500, 502, 503, 504]failover_custom_origin_source (
Optional
[CustomOriginConfig
]) – A custom origin source for failover in case the s3OriginSource returns invalid status code. Default: - no failover configurationfailover_s3_origin_source (
Optional
[S3OriginConfig
]) – An s3 origin source for failover in case the s3OriginSource returns invalid status code. Default: - no failover configurationorigin_headers (
Optional
[Mapping
[str
,str
]]) – (deprecated) Any additional headers to pass to the origin. Default: - No additional headers are passed.origin_path (
Optional
[str
]) – (deprecated) The relative path to the origin root to use for sources. Default: /s3_origin_source (
Optional
[S3OriginConfig
]) – An s3 origin source - if you’re using s3 for your assets.
Attributes
-
behaviors
¶ The behaviors associated with this source.
At least one (default) behavior must be included.
- Return type
List
[Behavior
]
-
connection_attempts
¶ The number of times that CloudFront attempts to connect to the origin.
You can specify 1, 2, or 3 as the number of attempts.
- Default
3
- Return type
Union
[int
,float
,None
]
-
connection_timeout
¶ The number of seconds that CloudFront waits when trying to establish a connection to the origin.
You can specify a number of seconds between 1 and 10 (inclusive).
- Default
cdk.Duration.seconds(10)
- Return type
Optional
[Duration
]
-
custom_origin_source
¶ A custom origin source - for all non-s3 sources.
- Return type
Optional
[CustomOriginConfig
]
-
failover_criteria_status_codes
¶ HTTP status code to failover to second origin.
- Default
[500, 502, 503, 504]
- Return type
Optional
[List
[FailoverStatusCode
]]
-
failover_custom_origin_source
¶ A custom origin source for failover in case the s3OriginSource returns invalid status code.
- Default
no failover configuration
- Return type
Optional
[CustomOriginConfig
]
-
failover_s3_origin_source
¶ An s3 origin source for failover in case the s3OriginSource returns invalid status code.
- Default
no failover configuration
- Return type
Optional
[S3OriginConfig
]
-
origin_headers
¶ (deprecated) Any additional headers to pass to the origin.
- Default
No additional headers are passed.
- Deprecated
Use originHeaders on s3OriginSource or customOriginSource
- Stability
deprecated
- Return type
Optional
[Mapping
[str
,str
]]
-
origin_path
¶ (deprecated) The relative path to the origin root to use for sources.
- Default
/
- Deprecated
Use originPath on s3OriginSource or customOriginSource
- Stability
deprecated
- Return type
Optional
[str
]
-
s3_origin_source
¶ An s3 origin source - if you’re using s3 for your assets.
- Return type
Optional
[S3OriginConfig
]