Skip to content

Commit

Permalink
Route53 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassz committed Jul 12, 2018
1 parent 7bbb019 commit 0544b5a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions modules/worker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,14 @@ resource "aws_lb_listener" "public_http" {
}

/* Route53 hosted zone */
resource "aws_route53_zone" "api" {
name = "${var.environment == "production" ? "" : "${var.environment}."}${var.api_hostname}"

lifecycle {
prevent_destroy = true
}
data "aws_route53_zone" "api" {
name = "${var.api_hostname}"
depends_on = ["aws_route53_zone.api"]
}

resource "aws_route53_record" "lb" {
zone_id = "${aws_route53_zone.api.zone_id}"
name = "${aws_route53_zone.api.name}"
zone_id = "${data.aws_route53_zone.api.zone_id}"
name = "${var.environment == "production" ? "" : "${var.environment}."}${var.api_hostname}"
type = "A"

alias {
Expand Down

0 comments on commit 0544b5a

Please sign in to comment.