« blib/lib/Paws/CloudFront/CreateStreamingDistributionWithTagsResult.pm
↑ Summary
blib/lib/Paws/CloudFront/CustomErrorResponses.pm »
| 1 | # Generated by default/object.tt | ||
| 2 | package Paws::CloudFront::CustomErrorResponse; | ||
| 3 | use Moose; | ||
| 4 | has ErrorCachingMinTTL => (is => 'ro', isa => 'Int'); | ||
| 5 | has ErrorCode => (is => 'ro', isa => 'Int', required => 1); | ||
| 6 | has ResponseCode => (is => 'ro', isa => 'Str'); | ||
| 7 | has ResponsePagePath => (is => 'ro', isa => 'Str'); | ||
| 8 | |||
| 9 | 1; | ||
| 10 | |||
| 11 | ### main pod documentation begin ### | ||
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | Paws::CloudFront::CustomErrorResponse | ||
| 16 | |||
| 17 | =head1 USAGE | ||
| 18 | |||
| 19 | This class represents one of two things: | ||
| 20 | |||
| 21 | =head3 Arguments in a call to a service | ||
| 22 | |||
| 23 | Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. | ||
| 24 | Each attribute should be used as a named argument in the calls that expect this type of object. | ||
| 25 | |||
| 26 | As an example, if Att1 is expected to be a Paws::CloudFront::CustomErrorResponse object: | ||
| 27 | |||
| 28 | $service_obj->Method(Att1 => { ErrorCachingMinTTL => $value, ..., ResponsePagePath => $value }); | ||
| 29 | |||
| 30 | =head3 Results returned from an API call | ||
| 31 | |||
| 32 | Use accessors for each attribute. If Att1 is expected to be an Paws::CloudFront::CustomErrorResponse object: | ||
| 33 | |||
| 34 | $result = $service_obj->Method(...); | ||
| 35 | $result->Att1->ErrorCachingMinTTL | ||
| 36 | |||
| 37 | =head1 DESCRIPTION | ||
| 38 | |||
| 39 | A complex type that controls: | ||
| 40 | |||
| 41 | =over | ||
| 42 | |||
| 43 | =item * | ||
| 44 | |||
| 45 | Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range | ||
| 46 | with custom error messages before returning the response to the viewer. | ||
| 47 | |||
| 48 | =item * | ||
| 49 | |||
| 50 | How long CloudFront caches HTTP status codes in the 4xx and 5xx range. | ||
| 51 | |||
| 52 | =back | ||
| 53 | |||
| 54 | For more information about custom error pages, see Customizing Error | ||
| 55 | Responses | ||
| 56 | (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) | ||
| 57 | in the I<Amazon CloudFront Developer Guide>. | ||
| 58 | |||
| 59 | =head1 ATTRIBUTES | ||
| 60 | |||
| 61 | |||
| 62 | =head2 ErrorCachingMinTTL => Int | ||
| 63 | |||
| 64 | The minimum amount of time, in seconds, that you want CloudFront to | ||
| 65 | cache the HTTP status code specified in C<ErrorCode>. When this time | ||
| 66 | period has elapsed, CloudFront queries your origin to see whether the | ||
| 67 | problem that caused the error has been resolved and the requested | ||
| 68 | object is now available. | ||
| 69 | |||
| 70 | For more information, see Customizing Error Responses | ||
| 71 | (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) | ||
| 72 | in the I<Amazon CloudFront Developer Guide>. | ||
| 73 | |||
| 74 | |||
| 75 | =head2 B<REQUIRED> ErrorCode => Int | ||
| 76 | |||
| 77 | The HTTP status code for which you want to specify a custom error page | ||
| 78 | and/or a caching duration. | ||
| 79 | |||
| 80 | |||
| 81 | =head2 ResponseCode => Str | ||
| 82 | |||
| 83 | The HTTP status code that you want CloudFront to return to the viewer | ||
| 84 | along with the custom error page. There are a variety of reasons that | ||
| 85 | you might want CloudFront to return a status code different from the | ||
| 86 | status code that your origin returned to CloudFront, for example: | ||
| 87 | |||
| 88 | =over | ||
| 89 | |||
| 90 | =item * | ||
| 91 | |||
| 92 | Some Internet devices (some firewalls and corporate proxies, for | ||
| 93 | example) intercept HTTP 4xx and 5xx and prevent the response from being | ||
| 94 | returned to the viewer. If you substitute C<200>, the response | ||
| 95 | typically won't be intercepted. | ||
| 96 | |||
| 97 | =item * | ||
| 98 | |||
| 99 | If you don't care about distinguishing among different client errors or | ||
| 100 | server errors, you can specify C<400> or C<500> as the C<ResponseCode> | ||
| 101 | for all 4xx or 5xx errors. | ||
| 102 | |||
| 103 | =item * | ||
| 104 | |||
| 105 | You might want to return a C<200> status code (OK) and static website | ||
| 106 | so your customers don't know that your website is down. | ||
| 107 | |||
| 108 | =back | ||
| 109 | |||
| 110 | If you specify a value for C<ResponseCode>, you must also specify a | ||
| 111 | value for C<ResponsePagePath>. | ||
| 112 | |||
| 113 | |||
| 114 | =head2 ResponsePagePath => Str | ||
| 115 | |||
| 116 | The path to the custom error page that you want CloudFront to return to | ||
| 117 | a viewer when your origin returns the HTTP status code specified by | ||
| 118 | C<ErrorCode>, for example, C</4xx-errors/403-forbidden.html>. If you | ||
| 119 | want to store your objects and your custom error pages in different | ||
| 120 | locations, your distribution must include a cache behavior for which | ||
| 121 | the following is true: | ||
| 122 | |||
| 123 | =over | ||
| 124 | |||
| 125 | =item * | ||
| 126 | |||
| 127 | The value of C<PathPattern> matches the path to your custom error | ||
| 128 | messages. For example, suppose you saved custom error pages for 4xx | ||
| 129 | errors in an Amazon S3 bucket in a directory named C</4xx-errors>. Your | ||
| 130 | distribution must include a cache behavior for which the path pattern | ||
| 131 | routes requests for your custom error pages to that location, for | ||
| 132 | example, C</4xx-errors/*>. | ||
| 133 | |||
| 134 | =item * | ||
| 135 | |||
| 136 | The value of C<TargetOriginId> specifies the value of the C<ID> element | ||
| 137 | for the origin that contains your custom error pages. | ||
| 138 | |||
| 139 | =back | ||
| 140 | |||
| 141 | If you specify a value for C<ResponsePagePath>, you must also specify a | ||
| 142 | value for C<ResponseCode>. | ||
| 143 | |||
| 144 | We recommend that you store custom error pages in an Amazon S3 bucket. | ||
| 145 | If you store custom error pages on an HTTP server and the server starts | ||
| 146 | to return 5xx errors, CloudFront can't get the files that you want to | ||
| 147 | return to viewers because the origin server is unavailable. | ||
| 148 | |||
| 149 | |||
| 150 | |||
| 151 | =head1 SEE ALSO | ||
| 152 | |||
| 153 | This class forms part of L<Paws>, describing an object used in L<Paws::CloudFront> | ||
| 154 | |||
| 155 | =head1 BUGS and CONTRIBUTIONS | ||
| 156 | |||
| 157 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 158 | |||
| 159 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 160 | |||
| 161 | =cut | ||
| 162 |