ErrorResponse

class aws_cdk.aws_cloudfront.ErrorResponse(*, http_status, response_http_status=None, response_page_path=None, ttl=None)

Bases: object

Options for configuring custom error responses.

Parameters
  • http_status (Union[int, float]) – The HTTP status code for which you want to specify a custom error page and/or a caching duration.

  • response_http_status (Union[int, float, None]) – 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: - not set, the error code will be returned as the response code.

  • response_page_path (Optional[str]) – 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.

  • ttl (Optional[Duration]) – 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

stability :stability: experimental

Attributes

http_status

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

stability :stability: experimental

Return type

Union[int, float]

response_http_status

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 :default: - not set, the error code will be returned as the response code.

stability :stability: experimental

Return type

Union[int, float, None]

response_page_path

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 :default: - the default CloudFront response is shown.

stability :stability: experimental

Return type

Optional[str]

ttl

The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode.

default :default: - the default caching TTL behavior applies

stability :stability: experimental

Return type

Optional[Duration]