Class RestApiOrigin.Builder

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

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

    • create

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

      @Stability(Stable) public RestApiOrigin.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 RestApiOrigin.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 RestApiOrigin.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 RestApiOrigin.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:
    • keepaliveTimeout

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

      Default: Duration.seconds(5)

      Parameters:
      keepaliveTimeout - Specifies how long, in seconds, CloudFront persists its connection to the origin. This parameter is required.
      Returns:
      this
    • readTimeout

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

      Default: Duration.seconds(30)

      Parameters:
      readTimeout - Specifies how long, in seconds, CloudFront waits for a response from the origin, also known as the origin response timeout. This parameter is required.
      Returns:
      this
    • build

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