Skip to content

Commit

Permalink
normalize disable method (#27)
Browse files Browse the repository at this point in the history
* normalize disable method

switch variable default to empty string, switch enable bool to check length of zone_id variable

* regenerate readme
  • Loading branch information
MoonMoon1919 authored and osterman committed Oct 11, 2018
1 parent d129bdf commit eb3a647
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Available targets:
| tags | Additional tags (_e.g._ map("BusinessUnit","ABC") | map | `<map>` | no |
| transit_encryption_enabled | Enable TLS | string | `true` | no |
| vpc_id | AWS VPC id | string | `REQUIRED` | no |
| zone_id | Route53 DNS Zone id | string | `false` | no |
| zone_id | Route53 DNS Zone id | string | `` | no |

## Outputs

Expand Down
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
| tags | Additional tags (_e.g._ map("BusinessUnit","ABC") | map | `<map>` | no |
| transit_encryption_enabled | Enable TLS | string | `true` | no |
| vpc_id | AWS VPC id | string | `REQUIRED` | no |
| zone_id | Route53 DNS Zone id | string | `false` | no |
| zone_id | Route53 DNS Zone id | string | `` | no |

## Outputs

Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ resource "aws_cloudwatch_metric_alarm" "cache_memory" {

module "dns" {
source = "git::https://github.com/cloudposse/terraform-aws-route53-cluster-hostname.git?ref=tags/0.2.1"
enabled = "${var.enabled == "true" && var.zone_id != "false"}"
enabled = "${var.enabled == "true" && length(var.zone_id) > 0 ? "true" : "false"}"
namespace = "${var.namespace}"
name = "${var.name}"
stage = "${var.stage}"
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ variable "availability_zones" {
}

variable "zone_id" {
default = "false"
default = ""
description = "Route53 DNS Zone id"
}

Expand Down

0 comments on commit eb3a647

Please sign in to comment.