Skip to content

Commit

Permalink
Add support for custom_error_response (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
osterman authored Oct 12, 2017
1 parent b469077 commit d9af1d7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ aws acm request-certificate --domain-name example.com --subject-alternative-name
| `tags` | `{}` | Additional tags (e.g. `map("BusinessUnit","XYZ")` | No |
| `acm_certificate_arn` | `` | Existing ACM Certificate ARN | No |
| `aliases` | `[]` | List of aliases. CAUTION! Names MUSTN'T contain trailing `.` | Yes |
| `custom_error_response` | `[]` | List of one or more custom error response element maps | No |
| `allowed_methods` | `["*"]` | List of allowed methods (e.g. ` GET, PUT, POST, DELETE, HEAD`) for AWS CloudFront | No |
| `cached_methods` | `["GET", "HEAD"]` | List of cached methods (e.g. ` GET, PUT, POST, DELETE, HEAD`) | No |
| `comment` | `Managed by Terraform` | Comment for the origin access identity | No |
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ resource "aws_cloudfront_distribution" "default" {

aliases = ["${var.aliases}"]

custom_error_response = ["${var.custom_error_response}"]

origin {
domain_name = "${var.origin_domain_name}"
origin_id = "${module.distribution_label.id}"
Expand Down
9 changes: 9 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ variable "aliases" {
default = []
}

variable "custom_error_response" {
# http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html#custom-error-pages-procedure
# https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html#custom-error-response-arguments
description = "(Optional) - List of one or more custom error response element maps"

type = "list"
default = []
}

variable "origin_domain_name" {
description = "(Required) - The DNS domain name of your custom origin (e.g. website)"
default = ""
Expand Down

0 comments on commit d9af1d7

Please sign in to comment.