Class S3Origin.Builder

java.lang.Object
software.amazon.awscdk.services.cloudfront.origins.S3Origin.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<S3Origin>
Enclosing class:
S3Origin

@Stability(Stable) public static final class S3Origin.Builder extends Object implements software.amazon.jsii.Builder<S3Origin>
A fluent builder for S3Origin.
  • Method Details

    • create

      @Stability(Stable) public static S3Origin.Builder create(IBucket bucket)
      Parameters:
      bucket - This parameter is required.
      Returns:
      a new instance of S3Origin.Builder.
    • connectionAttempts

      @Stability(Stable) public S3Origin.Builder connectionAttempts(Number connectionAttempts)
      The number of times that CloudFront attempts to connect to the origin;

      valid values are 1, 2, or 3 attempts.

      Default: 3

      Parameters:
      connectionAttempts - The number of times that CloudFront attempts to connect to the origin;. This parameter is required.
      Returns:
      this
    • connectionTimeout

      @Stability(Stable) public S3Origin.Builder connectionTimeout(Duration connectionTimeout)
      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)

      Parameters:
      connectionTimeout - The number of seconds that CloudFront waits when trying to establish a connection to the origin. This parameter is required.
      Returns:
      this
    • customHeaders

      @Stability(Stable) public S3Origin.Builder customHeaders(Map<String,String> customHeaders)
      A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.

      Default: {}

      Parameters:
      customHeaders - A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. This parameter is required.
      Returns:
      this
    • originShieldRegion

      @Stability(Stable) public S3Origin.Builder originShieldRegion(String originShieldRegion)
      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

      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. This parameter is required.
      Returns:
      this
      See Also:
    • originPath

      @Stability(Stable) public S3Origin.Builder originPath(String originPath)
      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: '/'

      Parameters:
      originPath - An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin. This parameter is required.
      Returns:
      this
    • originAccessIdentity

      @Stability(Stable) public S3Origin.Builder originAccessIdentity(IOriginAccessIdentity originAccessIdentity)
      An optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket.

      Default: - An Origin Access Identity will be created.

      Parameters:
      originAccessIdentity - An optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public S3Origin build()
      Specified by:
      build in interface software.amazon.jsii.Builder<S3Origin>
      Returns:
      a newly built instance of S3Origin.