Skip to content

Commit

Permalink
Merge pull request #3 from VEBERArnaudAWS/refactor/tf-0.12
Browse files Browse the repository at this point in the history
refactor(tf): update for ~> 0.12
  • Loading branch information
VEBERArnaud committed Aug 27, 2019
2 parents 4c445d3 + e6ec514 commit eb0d066
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions route53_records.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
resource "aws_route53_record" "stg_ns" {
count = "${var.bypass == "true" ? 0 : 1}"
count = var.bypass == "true" ? 0 : 1

zone_id = "${aws_route53_zone.prd.zone_id}"
zone_id = aws_route53_zone.prd.zone_id

name = "${lookup(var.env_names, "stg")}"
name = var.env_names[stg]
type = "NS"
ttl = "30"

records = ["${aws_route53_zone.stg.name_servers}"]
records = [aws_route53_zone.stg.name_servers]
}
20 changes: 10 additions & 10 deletions route53_zones.tf
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
resource "aws_route53_zone" "prd" {
count = "${var.bypass == "true" ? 0 : 1}"
count = var.bypass == "true" ? 0 : 1

name = "${lookup(var.env_dns_zones_prefix, "prd")}${var.domain}"
name = "${var.env_dns_zones_prefix[prd]}${var.domain}"

tags {
tags = {
Workspace = "prd"
Environment = "${lookup(var.env_names, "prd")}"
terraformed = "true"
Environment = var.env_names[prd]
terraformed = true
}
}

resource "aws_route53_zone" "stg" {
count = "${var.bypass == "true" ? 0 : 1}"
count = var.bypass == "true" ? 0 : 1

name = "${lookup(var.env_dns_zones_prefix, "stg")}${var.domain}"
name = "${var.env_dns_zones_prefix[stg]}${var.domain}"

tags {
tags = {
Workspace = "stg"
Environment = "${lookup(var.env_names, "stg")}"
terraformed = "true"
Environment = var.env_names[stg]
terraformed = true
}
}
8 changes: 4 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
variable "bypass" {
type = "string"
type = string
}

variable "domain" {
type = "string"
type = string
}

variable "env_dns_zones_prefix" {
type = "map"
type = object({ stg = string, prd = string })
}

variable "env_names" {
type = "map"
type = object({ stg = string, prd = string })
}

0 comments on commit eb0d066

Please sign in to comment.