Class ErrorResponse.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • httpStatus

      @Stability(Stable) public ErrorResponse.Builder httpStatus(Number httpStatus)
      Parameters:
      httpStatus - The HTTP status code for which you want to specify a custom error page and/or a caching duration. This parameter is required.
      Returns:
      this
    • responseHttpStatus

      @Stability(Stable) public ErrorResponse.Builder responseHttpStatus(Number responseHttpStatus)
      Parameters:
      responseHttpStatus - The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. If you specify a value for responseHttpStatus, you must also specify a value for responsePagePath.
      Returns:
      this
    • responsePagePath

      @Stability(Stable) public ErrorResponse.Builder responsePagePath(String responsePagePath)
      Parameters:
      responsePagePath - The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the httpStatus, for example, /4xx-errors/403-forbidden.html.
      Returns:
      this
    • ttl

      @Stability(Stable) public ErrorResponse.Builder ttl(Duration ttl)
      Sets the value of ErrorResponse.getTtl()
      Parameters:
      ttl - The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode.
      Returns:
      this
    • build

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