Class SourceConfiguration.Builder
java.lang.Object
software.amazon.awscdk.services.cloudfront.SourceConfiguration.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SourceConfiguration>
- Enclosing interface:
SourceConfiguration
@Stability(Stable)
public static final class SourceConfiguration.Builder
extends Object
implements software.amazon.jsii.Builder<SourceConfiguration>
A builder for
SourceConfiguration
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofSourceConfiguration.getBehaviors()
build()
Builds the configured instance.connectionAttempts
(Number connectionAttempts) Sets the value ofSourceConfiguration.getConnectionAttempts()
connectionTimeout
(Duration connectionTimeout) Sets the value ofSourceConfiguration.getConnectionTimeout()
customOriginSource
(CustomOriginConfig customOriginSource) Sets the value ofSourceConfiguration.getCustomOriginSource()
failoverCriteriaStatusCodes
(List<? extends FailoverStatusCode> failoverCriteriaStatusCodes) Sets the value ofSourceConfiguration.getFailoverCriteriaStatusCodes()
failoverCustomOriginSource
(CustomOriginConfig failoverCustomOriginSource) Sets the value ofSourceConfiguration.getFailoverCustomOriginSource()
failoverS3OriginSource
(S3OriginConfig failoverS3OriginSource) Sets the value ofSourceConfiguration.getFailoverS3OriginSource()
originShieldRegion
(String originShieldRegion) Sets the value ofSourceConfiguration.getOriginShieldRegion()
s3OriginSource
(S3OriginConfig s3OriginSource) Sets the value ofSourceConfiguration.getS3OriginSource()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
behaviors
Sets the value ofSourceConfiguration.getBehaviors()
- Parameters:
behaviors
- The behaviors associated with this source. This parameter is required. At least one (default) behavior must be included.- Returns:
this
-
connectionAttempts
Sets the value ofSourceConfiguration.getConnectionAttempts()
- Parameters:
connectionAttempts
- The number of times that CloudFront attempts to connect to the origin. You can specify 1, 2, or 3 as the number of attempts.- Returns:
this
-
connectionTimeout
Sets the value ofSourceConfiguration.getConnectionTimeout()
- Parameters:
connectionTimeout
- 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).- Returns:
this
-
customOriginSource
@Stability(Stable) public SourceConfiguration.Builder customOriginSource(CustomOriginConfig customOriginSource) Sets the value ofSourceConfiguration.getCustomOriginSource()
- Parameters:
customOriginSource
- A custom origin source - for all non-s3 sources.- Returns:
this
-
failoverCriteriaStatusCodes
@Stability(Stable) public SourceConfiguration.Builder failoverCriteriaStatusCodes(List<? extends FailoverStatusCode> failoverCriteriaStatusCodes) Sets the value ofSourceConfiguration.getFailoverCriteriaStatusCodes()
- Parameters:
failoverCriteriaStatusCodes
- HTTP status code to failover to second origin.- Returns:
this
-
failoverCustomOriginSource
@Stability(Stable) public SourceConfiguration.Builder failoverCustomOriginSource(CustomOriginConfig failoverCustomOriginSource) Sets the value ofSourceConfiguration.getFailoverCustomOriginSource()
- Parameters:
failoverCustomOriginSource
- A custom origin source for failover in case the s3OriginSource returns invalid status code.- Returns:
this
-
failoverS3OriginSource
@Stability(Stable) public SourceConfiguration.Builder failoverS3OriginSource(S3OriginConfig failoverS3OriginSource) Sets the value ofSourceConfiguration.getFailoverS3OriginSource()
- Parameters:
failoverS3OriginSource
- An s3 origin source for failover in case the s3OriginSource returns invalid status code.- Returns:
this
-
originShieldRegion
Sets the value ofSourceConfiguration.getOriginShieldRegion()
- Parameters:
originShieldRegion
- When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.- Returns:
this
-
s3OriginSource
Sets the value ofSourceConfiguration.getS3OriginSource()
- Parameters:
s3OriginSource
- An s3 origin source - if you're using s3 for your assets.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<SourceConfiguration>
- Returns:
- a new instance of
SourceConfiguration
- Throws:
NullPointerException
- if any required attribute was not provided
-