File Coverage

blib/lib/Paws/CloudFront/CustomErrorResponse.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


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