You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,22 @@ of configuration elements from the bundle being served, allowing the bundle to b
11
11
12
12
This module also has an additional and separate artifactory module - more information on what this module provides can be found in the [Artifactory README](artifactory/README.md)
13
13
14
+
### React client side routing support
15
+
16
+
In order to support React's client side routing implementation, you'll need to provide the following value for the `cloudfront_custom_errors` variable as follows
17
+
18
+
```
19
+
cloudfront_custom_errors = [
20
+
{
21
+
error_caching_min_ttl = 300
22
+
error_code = 404
23
+
response_code = 200
24
+
response_page_path = "/index.html"
25
+
}]
26
+
```
27
+
28
+
The `response_page_path` (`/index.html` in this example) should match your static html file that invokes the React bundle. Further explanations for the settings can be found at https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html#custom-error-response-arguments.
29
+
14
30
### Implementation patterns
15
31
16
32
This module is used to provide the infrastructure for both serving static content in a way that creates pipeline building blocks that allows users to easily construct a pipeline to provide continuous delivery patterns. An example pipeline is shown below:
@@ -27,6 +43,8 @@ This repo supports version 0.11 and 0.12 of Terraform. The implementation patter
27
43
## Contributions
28
44
All contributions are accepted, details on how to contribute can be found in [contrib.md](contrib.md).
29
45
46
+
---
47
+
30
48
## Providers
31
49
32
50
| Name | Version |
@@ -45,6 +63,7 @@ All contributions are accepted, details on how to contribute can be found in [co
45
63
| url | The custom URL to access the site. Must match the certificate name to provide a valid TLS connection. |`any`| n/a | yes |
46
64
| cloudfront\_allowed\_methods | Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. |`list(string)`| <pre>[<br> "GET",<br> "HEAD",<br> "OPTIONS"<br>]<br></pre> | no |
47
65
| cloudfront\_cached\_methods | Controls whether CloudFront caches the response to requests using the specified HTTP methods. |`list(string)`| <pre>[<br> "GET",<br> "HEAD"<br>]<br></pre> | no |
66
+
| cloudfront\_custom\_errors | A map of custom error settings for the CloudFront Distribution | <pre>list(object({<br>error_caching_min_ttl = number<br>error_code = number<br>response_code = number<br>response_page_path = string<br>}))<br></pre> |`[]`| no |
48
67
| cloudfront\_tags | Additional tags to be added to all cloudfront resources. |`map(any)`|`{}`| no |
49
68
| comment | A comment for the Cloudfront distribution resource |`string`|`""`| no |
50
69
| cors\_allowed\_methods | Specifies which methods are allowed. Can be GET, PUT, POST, DELETE or HEAD. Defaults to `GET`, `PUT`, `POST`. |`list(string)`| <pre>[<br> "GET",<br> "PUT",<br> "POST"<br>]<br></pre> | no |
0 commit comments