Skip to content
Permalink
Browse files

terraform refactoring to work with prod differences

  • Loading branch information...
David Smith
David Smith committed Apr 11, 2019
1 parent 6132b92 commit 28966329cf535298686eb75c85d39bf7cb7f3e24
@@ -1,3 +1,4 @@
machines.json
bastion_machines.json
network.json
network.json
secrets.json
@@ -1,8 +1,8 @@
{
"githubClientId": "someclientid",
"githubClientSecret": "someclientsecret",
"jwtSignature": "somesignature",
"pagerdutyKey": "somekey",
"githubClientId": "someclientid",
"githubClientSecret": "someclientsecret",
"jwtSignature": "somesignature",
"pagerdutyKey": "somekey",
"googleClientID": "somekey",
"googleClientSecret": "somekey"
}
@@ -118,7 +118,7 @@ resource "aws_alb_listener_rule" "playground" {
}
condition {
field = "host-header"
values = ["*.plutus.*"]
values = ["${local.plutus_domain_name}"]
}
}

@@ -135,7 +135,7 @@ resource "aws_alb_target_group_attachment" "playground_b" {

resource "aws_route53_record" "playground_alb" {
zone_id = "${var.plutus_public_zone}"
name = "${var.env}.${var.plutus_tld}"
name = "${local.plutus_domain_name}"
type = "A"
alias {
name = "${aws_alb.plutus.dns_name}"
@@ -164,7 +164,7 @@ resource "aws_alb_listener_rule" "meadow" {
}
condition {
field = "host-header"
values = ["*.marlowe.*"]
values = ["${local.meadow_domain_name}"]
}
}

@@ -181,7 +181,7 @@ resource "aws_alb_target_group_attachment" "meadow_b" {

resource "aws_route53_record" "meadow_alb" {
zone_id = "${var.meadow_public_zone}"
name = "${var.env}.${var.meadow_tld}"
name = "${local.meadow_domain_name}"
type = "A"
alias {
name = "${aws_alb.plutus.dns_name}"
@@ -200,6 +200,7 @@ resource "aws_alb_target_group" "monitoring" {
}
}


resource "aws_alb_listener_rule" "monitoring" {
depends_on = ["aws_alb_target_group.monitoring"]
listener_arn = "${aws_alb_listener.playground.arn}"
@@ -210,7 +211,7 @@ resource "aws_alb_listener_rule" "monitoring" {
}
condition {
field = "host-header"
values = ["monitoring.*"]
values = ["${local.monitoring_domain_name}"]
}
}

@@ -222,11 +223,11 @@ resource "aws_alb_target_group_attachment" "monitoring_a" {

resource "aws_route53_record" "monitoring_alb" {
zone_id = "${var.monitoring_public_zone}"
name = "monitoring.${var.monitoring_tld}"
name = "${local.monitoring_domain_name}"
type = "A"
alias {
name = "${aws_alb.plutus.dns_name}"
zone_id = "${aws_alb.plutus.zone_id}"
evaluate_target_health = true
}
}
}
@@ -0,0 +1,6 @@
locals {
monitoring_domain_name = "${var.monitoring_full_domain != "" ? var.monitoring_full_domain : "${var.env}.${var.monitoring_tld}"}"
meadow_domain_name = "${var.meadow_full_domain != "" ? var.meadow_full_domain : "${var.env}.${var.meadow_tld}"}"
plutus_domain_name = "${var.plutus_full_domain != "" ? var.plutus_full_domain : "${var.env}.${var.plutus_tld}"}"
}

@@ -35,7 +35,7 @@ locals {
name = "nixops"
ip = "${element(concat(aws_instance.nixops.*.private_ip, list("")), 0)}"
dns = "nixops.${element(concat(aws_route53_zone.plutus_private_zone.*.name, list("")), 0)}"
externalDns = "monitoring.${var.monitoring_tld}"
externalDns = "${local.monitoring_domain_name}"
}

bastionA = {
@@ -16,6 +16,10 @@ variable "plutus_tld" {
default = "plutus.iohkdev.io"
}

variable "plutus_full_domain" {
default = ""
}

variable "plutus_public_zone" {
default = "ZBC2AQBA8QH4G"
}
@@ -24,6 +28,10 @@ variable "meadow_tld" {
default = "marlowe.iohkdev.io"
}

variable "meadow_full_domain" {
default = ""
}

variable "meadow_public_zone" {
default = "Z1VIYCTCY8RMLZ"
}
@@ -32,6 +40,10 @@ variable "monitoring_tld" {
default = "goguen.monitoring.iohkdev.io"
}

variable "monitoring_full_domain" {
default = ""
}

variable "monitoring_public_zone" {
default = "Z2Y3TWJMJ0Q6Z7"
}

0 comments on commit 2896632

Please sign in to comment.
You can’t perform that action at this time.