DistributionCustomErrorResponseArgs

data class DistributionCustomErrorResponseArgs(val errorCachingMinTtl: Output<Double>? = null, val errorCode: Output<Int>, val responseCode: Output<Int>? = null, val responsePagePath: Output<String>? = null) : ConvertibleToJava<DistributionCustomErrorResponseArgs>

A complex type that controls:

  • Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer.

  • How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide.

Constructors

Link copied to clipboard
constructor(errorCachingMinTtl: Output<Double>? = null, errorCode: Output<Int>, responseCode: Output<Int>? = null, responsePagePath: Output<String>? = null)

Properties

Link copied to clipboard
val errorCachingMinTtl: Output<Double>? = null

The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in `ErrorCode`. When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available. For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide.

Link copied to clipboard
val errorCode: Output<Int>

The HTTP status code for which you want to specify a custom error page and/or a caching duration.

Link copied to clipboard
val responseCode: Output<Int>? = null

The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example:

Link copied to clipboard
val responsePagePath: Output<String>? = null

The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by `ErrorCode`, for example, `/4xx-errors/403-forbidden.html`. If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true:

Functions

Link copied to clipboard
open override fun toJava(): DistributionCustomErrorResponseArgs