Skip to content

Commit 0ac4ad3

Browse files
garzparzosterman
authored andcommitted
Added 'custom_error_response' input param support for cdn distribution (#28)
* Update variables.tf Added custom_error_reponse variable to support CDN custom error. * Update main.tf Added custom_error_response param. * Update README.md Added custom_error_response input param. * Formatted main. * Updated terraform.md and removed manual entry from README. * Update terraform.md Removed Optional from attribute.
1 parent bda2f3f commit 0ac4ad3

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Terraform module to easily provision an AWS CloudFront CDN with an S3 or custom
1010

1111
---
1212

13-
This project is part of our comprehensive ["SweetOps"](https://docs.cloudposse.com) approach towards DevOps.
13+
This project is part of our comprehensive ["SweetOps"](https://docs.cloudposse.com) approach towards DevOps.
1414

1515

1616
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
@@ -163,9 +163,9 @@ File a GitHub [issue](https://github.com/cloudposse/terraform-aws-cloudfront-s3-
163163

164164
## Commercial Support
165165

166-
Work directly with our team of DevOps experts via email, slack, and video conferencing.
166+
Work directly with our team of DevOps experts via email, slack, and video conferencing.
167167

168-
We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer.
168+
We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer.
169169

170170
[![E-Mail](https://img.shields.io/badge/[email protected])](mailto:[email protected])
171171

@@ -175,7 +175,7 @@ We provide [*commercial support*][commercial_support] for all of our [Open Sourc
175175
- **Bug Fixes.** We'll rapidly work to fix any bugs in our projects.
176176
- **Build New Terraform Modules.** We'll develop original modules to provision infrastructure.
177177
- **Cloud Architecture.** We'll assist with your cloud strategy and design.
178-
- **Implementation.** We'll provide hands-on support to implement our reference architectures.
178+
- **Implementation.** We'll provide hands-on support to implement our reference architectures.
179179

180180

181181
## Community Forum
@@ -209,9 +209,9 @@ Copyright © 2017-2018 [Cloud Posse, LLC](https://cloudposse.com)
209209

210210

211211

212-
## License
212+
## License
213213

214-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
214+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
215215

216216
See [LICENSE](LICENSE) for full details.
217217

@@ -252,7 +252,7 @@ This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? P
252252

253253
We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We love [Open Source Software](https://github.com/cloudposse/)!
254254

255-
We offer paid support on all of our projects.
255+
We offer paid support on all of our projects.
256256

257257
Check out [our other projects][github], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation.
258258

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
| cors_allowed_origins | List of allowed origins (e.g. example.com, test.com) for S3 bucket | list | `<list>` | no |
1717
| cors_expose_headers | List of expose header in the response for S3 bucket | list | `<list>` | no |
1818
| cors_max_age_seconds | Time in seconds that browser can cache the response for S3 bucket | string | `3600` | no |
19+
| custom_error_response | List of one or more custom error response element maps | list | `<list>` | no |
1920
| default_root_object | Object that CloudFront return when requests the root URL | string | `index.html` | no |
2021
| default_ttl | Default amount of time (in seconds) that an object is in a CloudFront cache | string | `60` | no |
2122
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ resource "aws_cloudfront_distribution" "default" {
164164
}
165165
}
166166

167+
custom_error_response = ["${var.custom_error_response}"]
168+
167169
tags = "${module.distribution_label.tags}"
168170
}
169171

variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,12 @@ DOC
248248

249249
default = "aws-cli"
250250
}
251+
252+
variable "custom_error_response" {
253+
# http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html#custom-error-pages-procedure
254+
# https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html#custom-error-response-arguments
255+
description = "(Optional) - List of one or more custom error response element maps"
256+
257+
type = "list"
258+
default = []
259+
}

0 commit comments

Comments
 (0)