From b646958b20adac15cb52f53f7ba7461457640f18 Mon Sep 17 00:00:00 2001 From: VEBER Arnaud Date: Fri, 18 Jan 2019 15:07:14 +0100 Subject: [PATCH] feat(module): implement bypass --- route53_records.tf | 2 ++ route53_zones.tf | 4 ++++ variables.tf | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/route53_records.tf b/route53_records.tf index 2ae9e8b..16a8249 100644 --- a/route53_records.tf +++ b/route53_records.tf @@ -1,4 +1,6 @@ resource "aws_route53_record" "stg_ns" { + count = "${var.bypass == "true" ? 0 : 1}" + zone_id = "${aws_route53_zone.prd.zone_id}" name = "${lookup(var.env_names, "stg")}" diff --git a/route53_zones.tf b/route53_zones.tf index 40982a2..b22c2c7 100644 --- a/route53_zones.tf +++ b/route53_zones.tf @@ -1,4 +1,6 @@ resource "aws_route53_zone" "prd" { + count = "${var.bypass == "true" ? 0 : 1}" + name = "${lookup(var.env_dns_zones_prefix, "prd")}${var.domain}" tags { @@ -9,6 +11,8 @@ resource "aws_route53_zone" "prd" { } resource "aws_route53_zone" "stg" { + count = "${var.bypass == "true" ? 0 : 1}" + name = "${lookup(var.env_dns_zones_prefix, "stg")}${var.domain}" tags { diff --git a/variables.tf b/variables.tf index cb6b51b..6be5323 100644 --- a/variables.tf +++ b/variables.tf @@ -1,3 +1,7 @@ +variable "bypass" { + type = "string" +} + variable "domain" { type = "string" }