Skip to content

Commit

Permalink
Add Support for Vary Headers for CloudFront (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
goruha authored and osterman committed Oct 17, 2017
1 parent d9af1d7 commit 0a66af5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ aws acm request-certificate --domain-name example.com --subject-alternative-name
| `default_root_object` | `index.html` | Object that CloudFront return when requests the root URL | No |
| `enabled` | `true` | State of CloudFront | No |
| `forward_cookies` | `none` | Forward cookies to the origin that is associated with this cache behavior | No |
| `forward_headers` | `[]` | Specify headers that you want CloudFront to vary upon for this cache behavior. Specify `*` to include all headers. | No |
| `forward_query_string` | `false` | Forward query strings to the origin that is associated with this cache behavior | No |
| `geo_restriction_locations` | `[]` | List of country codes for which CloudFront either to distribute content (whitelist) or not distribute your content (blacklist) | No |
| `geo_restriction_type` | `none` | Method that use to restrict distribution of your content by country: `none`, `whitelist`, or `blacklist` | No |
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ resource "aws_cloudfront_distribution" "default" {
compress = "${var.compress}"

forwarded_values {
headers = ["${var.forward_headers}"]

query_string = "${var.forward_query_string}"

cookies {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ variable "forward_query_string" {
default = "false"
}

variable "forward_headers" {
description = "Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify `*` to include all headers."
type = "list"
default = []
}

variable "forward_cookies" {
default = "none"
}
Expand Down

0 comments on commit 0a66af5

Please sign in to comment.