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 forresponseHttpStatus
, you must also specify a value forresponsePagePath
. Default: - 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 thehttpStatus
, 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
Attributes
-
http_status
¶ The HTTP status code for which you want to specify a custom error page and/or a caching duration.
- 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 forresponsePagePath
.- Default
the error code will be returned as the response code.
- 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
the default CloudFront response is shown.
- Return type
Optional
[str
]