Show / Hide Table of Contents

Class CfnDistribution.CustomErrorResponseProperty

A complex type that controls:.

Inheritance
object
CfnDistribution.CustomErrorResponseProperty
Implements
CfnDistribution.ICustomErrorResponseProperty
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnDistribution.CustomErrorResponseProperty : CfnDistribution.ICustomErrorResponseProperty
Syntax (vb)
Public Class CfnDistribution.CustomErrorResponseProperty Implements 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

    Constructors

    CustomErrorResponseProperty()

    A complex type that controls:.

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

    Constructors

    CustomErrorResponseProperty()

    A complex type that controls:.

    public CustomErrorResponseProperty()
    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"
                   };

      Properties

      ErrorCachingMinTtl

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

      public double? ErrorCachingMinTtl { get; set; }
      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.

      public double ErrorCode { get; set; }
      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.

      public double? ResponseCode { get; set; }
      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:.

        public string? ResponsePagePath { get; set; }
        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

          Implements

          CfnDistribution.ICustomErrorResponseProperty
          Back to top Generated by DocFX