Class RestApiOriginProps.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • keepaliveTimeout

      @Stability(Stable) public RestApiOriginProps.Builder keepaliveTimeout(Duration keepaliveTimeout)
      Parameters:
      keepaliveTimeout - Specifies how long, in seconds, CloudFront persists its connection to the origin. The valid range is from 1 to 180 seconds, inclusive.

      Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time.

      Returns:
      this
    • readTimeout

      @Stability(Stable) public RestApiOriginProps.Builder readTimeout(Duration readTimeout)
      Parameters:
      readTimeout - 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 180 seconds, inclusive.

      Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time.

      Returns:
      this
    • originPath

      @Stability(Stable) public RestApiOriginProps.Builder originPath(String originPath)
      Sets the value of OriginProps.getOriginPath()
      Parameters:
      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').
      Returns:
      this
    • connectionAttempts

      @Stability(Stable) public RestApiOriginProps.Builder connectionAttempts(Number connectionAttempts)
      Parameters:
      connectionAttempts - The number of times that CloudFront attempts to connect to the origin;. valid values are 1, 2, or 3 attempts.
      Returns:
      this
    • connectionTimeout

      @Stability(Stable) public RestApiOriginProps.Builder connectionTimeout(Duration connectionTimeout)
      Parameters:
      connectionTimeout - The number of seconds that CloudFront waits when trying to establish a connection to the origin. Valid values are 1-10 seconds, inclusive.
      Returns:
      this
    • customHeaders

      @Stability(Stable) public RestApiOriginProps.Builder customHeaders(Map<String,String> customHeaders)
      Parameters:
      customHeaders - A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
      Returns:
      this
    • originId

      @Stability(Stable) public RestApiOriginProps.Builder originId(String originId)
      Sets the value of OriginOptions.getOriginId()
      Parameters:
      originId - A unique identifier for the origin. This value must be unique within the distribution.
      Returns:
      this
    • originShieldEnabled

      @Stability(Stable) public RestApiOriginProps.Builder originShieldEnabled(Boolean originShieldEnabled)
      Parameters:
      originShieldEnabled - Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false.
      Returns:
      this
    • originShieldRegion

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

      @Stability(Stable) public RestApiOriginProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<RestApiOriginProps>
      Returns:
      a new instance of RestApiOriginProps
      Throws:
      NullPointerException - if any required attribute was not provided