Skip to content

Commit

Permalink
Added ability to disable DNS record creation for aliases (#17)
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

* added dns_aliases_enabled
  • Loading branch information
rajcheval authored and aknysh committed Jul 30, 2018
1 parent f047f5a commit a693549
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Compiled files
*.tfstate
*.tfstate.backup
*.terraform.tfstate*

# Module directory
.terraform/
.terraform
.idea
*.iml

.build-harness
build-harness
**/.build-harness
**/build-harness
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Available targets:
| default_root_object | Object that CloudFront return when requests the root URL | string | `index.html` | no |
| default_ttl | Default amount of time (in seconds) that an object is in a CloudFront cache | string | `60` | no |
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |
| dns_aliases_enabled | Set to false to prevent dns records for aliases from being created | string | `true` | no |
| enabled | Set to false to prevent the module from creating any resources | string | `true` | no |
| forward_cookies | Specifies whether you want CloudFront to forward cookies to the origin. Valid options are all, none or whitelist | string | `none` | no |
| forward_cookies_whitelisted_names | List of forwarded cookie names | list | `<list>` | no |
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
| default_root_object | Object that CloudFront return when requests the root URL | string | `index.html` | no |
| default_ttl | Default amount of time (in seconds) that an object is in a CloudFront cache | string | `60` | no |
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |
| dns_aliases_enabled | Set to false to prevent dns records for aliases from being created | string | `true` | no |
| enabled | Set to false to prevent the module from creating any resources | string | `true` | no |
| forward_cookies | Specifies whether you want CloudFront to forward cookies to the origin. Valid options are all, none or whitelist | string | `none` | no |
| forward_cookies_whitelisted_names | List of forwarded cookie names | list | `<list>` | no |
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ resource "aws_cloudfront_distribution" "default" {
}

module "dns" {
source = "git::https://github.com/cloudposse/terraform-aws-route53-alias.git?ref=tags/0.2.4"
source = "git::https://github.com/cloudposse/terraform-aws-route53-alias.git?ref=tags/0.2.5"
enabled = "${var.dns_aliases_enabled}"
aliases = "${var.aliases}"
parent_zone_id = "${var.parent_zone_id}"
parent_zone_name = "${var.parent_zone_name}"
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ variable "enabled" {
description = "Set to false to prevent the module from creating any resources"
}

variable "dns_aliases_enabled" {
default = "true"
description = "Set to false to prevent dns records for aliases from being created"
}

variable "acm_certificate_arn" {
description = "Existing ACM Certificate ARN"
default = ""
Expand Down

0 comments on commit a693549

Please sign in to comment.