Skip to content

Commit

Permalink
Added ability to attache web acl to cloudfront (#16)
Browse files Browse the repository at this point in the history
* Added web_acl_id and dns_aliases_enabled

* Added web_acl_id

* removed dns_aliases_enabled

* added web_acl_id

* terraform fmt changes
  • Loading branch information
rajcheval authored and aknysh committed Jul 27, 2018
1 parent 12f64bd commit f047f5a
Show file tree
Hide file tree
Showing 4 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 @@ -116,6 +116,7 @@ Available targets:
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')`) | map | `<map>` | no |
| viewer_minimum_protocol_version | (Optional) The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. | string | `TLSv1` | no |
| viewer_protocol_policy | allow-all, redirect-to-https | string | `redirect-to-https` | no |
| web_acl_id | (Optional) - Web ACL ID that can be attached to the Cloudfront distribution | string | `` | no |

## Outputs

Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')`) | map | `<map>` | no |
| viewer_minimum_protocol_version | (Optional) The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. | string | `TLSv1` | no |
| viewer_protocol_policy | allow-all, redirect-to-https | string | `redirect-to-https` | no |
| web_acl_id | (Optional) - Web ACL ID that can be attached to the Cloudfront distribution | string | `` | no |

## Outputs

Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ resource "aws_cloudfront_distribution" "default" {

cache_behavior = "${var.cache_behavior}"

web_acl_id = "${var.web_acl_id}"

restrictions {
geo_restriction {
restriction_type = "${var.geo_restriction_type}"
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ variable "custom_error_response" {
default = []
}

variable "web_acl_id" {
description = "(Optional) - Web ACL ID that can be attached to the Cloudfront distribution"
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 f047f5a

Please sign in to comment.