Interface ErrorResponse

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
ErrorResponse.Jsii$Proxy

@Generated(value="jsii-pacmak/1.95.0 (build f1ff514)", date="2024-03-26T18:09:20.639Z") @Stability(Stable) public interface ErrorResponse extends software.amazon.jsii.JsiiSerializable
Options for configuring custom error responses.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 import software.amazon.awscdk.services.cloudfront.*;
 ErrorResponse errorResponse = ErrorResponse.builder()
         .httpStatus(123)
         // the properties below are optional
         .responseHttpStatus(123)
         .responsePagePath("responsePagePath")
         .ttl(Duration.minutes(30))
         .build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder for ErrorResponse
    static final class 
    An implementation for ErrorResponse
  • Method Summary

    Modifier and Type
    Method
    Description
     
    The HTTP status code for which you want to specify a custom error page and/or a caching duration.
    default Number
    The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.
    default String
    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.
    default Duration
    The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode.

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Method Details

    • getHttpStatus

      @Stability(Stable) @NotNull Number getHttpStatus()
      The HTTP status code for which you want to specify a custom error page and/or a caching duration.
    • getResponseHttpStatus

      @Stability(Stable) @Nullable default Number getResponseHttpStatus()
      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.

      Default: - the error code will be returned as the response code.

    • getResponsePagePath

      @Stability(Stable) @Nullable default String getResponsePagePath()
      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.

      Default: - the default CloudFront response is shown.

    • getTtl

      @Stability(Stable) @Nullable default Duration getTtl()
      The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode.

      Default: - the default caching TTL behavior applies

    • builder

      @Stability(Stable) static ErrorResponse.Builder builder()
      Returns:
      a ErrorResponse.Builder of ErrorResponse