Show / Hide Table of Contents

Interface CfnDistribution.ICustomErrorResponseProperty

A complex type that controls:.

Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface CfnDistribution.ICustomErrorResponseProperty
Syntax (vb)
Public Interface CfnDistribution.ICustomErrorResponseProperty
Remarks

    For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide .

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html

    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.AWS.CloudFront;
    
                 var customErrorResponseProperty = new CustomErrorResponseProperty {
                     ErrorCode = 123,
    
                     // the properties below are optional
                     ErrorCachingMinTtl = 123,
                     ResponseCode = 123,
                     ResponsePagePath = "responsePagePath"
                 };

    Synopsis

    Properties

    ErrorCachingMinTtl

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

    ErrorCode

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

    ResponseCode

    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 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:.

    Properties

    ErrorCachingMinTtl

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

    double? ErrorCachingMinTtl { get; }
    Property Value

    double?

    Remarks

    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 .

    Default: - 300

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-errorcachingminttl

    ErrorCode

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

    double ErrorCode { get; }
    Property Value

    double

    Remarks

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-errorcode

    ResponseCode

    The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.

    double? ResponseCode { get; }
    Property Value

    double?

    Remarks

    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:

      If you specify a value for ResponseCode , you must also specify a value for ResponsePagePath .

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-responsecode

      ResponsePagePath

      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:.

      string? ResponsePagePath { get; }
      Property Value

      string

      Remarks

        If you specify a value for ResponsePagePath , you must also specify a value for ResponseCode .

        We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable.

        See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-responsepagepath

        Back to top Generated by DocFX