Skip to content

Commit

Permalink
Add option to override DNS parent zone
Browse files Browse the repository at this point in the history
  • Loading branch information
snemetz committed Dec 28, 2018
1 parent a485a4a commit f4091dd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ This software is released under the MIT License (see `LICENSE`).
| container\_definition\_additional | Additional parameters to add to container definition. This is a json substring | string | `` | no |
| delimiter | Delimiter to be used between `name`, `namespaces`, `attributes`, etc. | string | `-` | no |
| dns\_aliases | Additional DNS names | list | `<list>` | no |
| dns\_parent\_zone\_name | DNS name of the parent zone to put this in | string | `` | no |
| docker\_command | String to override CMD in Docker container (default "") | string | `` | no |
| docker\_environment | List of environment maps of format { "name" = "var_name", "value" = "var_value" } | list | `<list>` | no |
| docker\_image | Docker image to use for task | string | `` | no |
Expand Down
15 changes: 10 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,16 @@ module "sg-lb" {
# DNS for LB
module "route53-aliases" {
#source = "git::https://github.com/devops-workflow/terraform-aws-route53-alias.git"
source = "devops-workflow/route53-alias/aws"
version = "0.2.4"
enabled = "${module.enabled.value && module.enable_lb.value ? 1 : 0}"
aliases = "${compact(concat(list(module.label.name), var.dns_aliases))}"
parent_zone_name = "${module.label.environment}.${module.label.organization}.com."
source = "devops-workflow/route53-alias/aws"
version = "0.2.4"
enabled = "${module.enabled.value && module.enable_lb.value ? 1 : 0}"
aliases = "${compact(concat(list(module.label.name), var.dns_aliases))}"

parent_zone_name = "${var.dns_parent_zone_name != "" ?
"${var.dns_parent_zone_name}" :
"${module.label.environment}.${module.label.organization}.com."
}"

target_dns_name = "${module.lb.dns_name}"
target_zone_id = "${module.lb.zone_id}"
evaluate_target_health = true
Expand Down
Binary file modified resource-plan-graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ variable "dns_aliases" {
default = []
}

variable "dns_parent_zone_name" {
description = "DNS name of the parent zone to put this in"
default = ""
}

//
// Variables specific to LB module
//
Expand Down

0 comments on commit f4091dd

Please sign in to comment.