Class ErrorResponse
Options for configuring custom error responses.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ErrorResponse : Object, IErrorResponse
Syntax (vb)
Public Class ErrorResponse
Inherits Object
Implements IErrorResponse
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.CloudFront;
var errorResponse = new ErrorResponse {
HttpStatus = 123,
// the properties below are optional
ResponseHttpStatus = 123,
ResponsePagePath = "responsePagePath",
Ttl = Duration.Minutes(30)
};
Synopsis
Constructors
ErrorResponse() |
Properties
HttpStatus | The HTTP status code for which you want to specify a custom error page and/or a caching duration. |
ResponseHttpStatus | The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. |
ResponsePagePath | The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the |
Ttl | The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode. |
Constructors
ErrorResponse()
public ErrorResponse()
Properties
HttpStatus
The HTTP status code for which you want to specify a custom error page and/or a caching duration.
public double HttpStatus { get; set; }
Property Value
System.Double
ResponseHttpStatus
The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.
public Nullable<double> ResponseHttpStatus { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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.
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.
public string ResponsePagePath { get; set; }
Property Value
System.String
Remarks
Default: - the default CloudFront response is shown.
Ttl
The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode.
public Duration Ttl { get; set; }
Property Value
Remarks
Default: - the default caching TTL behavior applies