Commit 05088684 authored by drechsau's avatar drechsau

refactor to only us-east-a for now

parent 3154b007
......@@ -19,7 +19,7 @@ module "vpc" {
#private_propagating_vgws = ["vgw-xxxxxxxx"]
#public_propagating_vgws = ["vgw-xxxxxxxx"]
enable_nat_gateway = "true"
enable_nat_gateway = "true"
enable_ipv6_cidr_block = "true"
azs = ["${var.azs}"]
azs = ["${var.azs}"]
}
resource "aws_eip" "natgw-b" {
vpc = true
}
#!# # I don't need no stinking AZs
#!#
#!# resource "aws_eip" "natgw-b" {
#!# vpc = true
#!# }
#!#
#!# resource "aws_nat_gateway" "natgw-b" {
#!# allocation_id = "${aws_eip.natgw-b.id}"
#!# subnet_id = "${aws_subnet.drone-deploy-mgmt-b.id}"
#!#
#!# tags {
#!# Name = "${var.name}-natgw-b"
#!# }
#!# }
#!#
#!# # create route tables
#!# resource "aws_route_table" "az-b" {
#!# vpc_id = "${module.vpc.vpc_id}"
#!#
#!# #propagating_vgws = ["${var.private_propagating_vgws_1}"]
#!#
#!# tags {
#!# Name = "${var.name}-rt-natgw-b"
#!# }
#!# }
#!#
#!# # create default route for route tables
#!# resource "aws_route" "nategw-b" {
#!# route_table_id = "${aws_route_table.az-b.id}"
#!# destination_cidr_block = "0.0.0.0/0"
#!# nat_gateway_id = "${aws_nat_gateway.natgw-b.id}"
#!# }
#!#
#!# # associate AZ routes to AZ NAT route tables
#!# resource "aws_route_table_association" "drone-deploy-mgmt-b" {
#!# subnet_id = "${aws_subnet.drone-deploy-mgmt-b.id}"
#!#
#!# route_table_id = "${module.vpc.public_route_table_id}"
#!# }
#!#
#!# resource "aws_route_table_association" "elb-b" {
#!# subnet_id = "${aws_subnet.elb-b.id}"
#!#
#!# route_table_id = "${module.vpc.public_route_table_id}"
#!# }
#!#
#!# #resource "aws_route_table_association" "databases-b" {
#!# # subnet_id = "${aws_subnet.databases-b.id}"
#!# #
#!# # route_table_id = "${aws_route_table.az-b.id}"
#!# #}
#!#
#!# #resource "aws_route_table_association" "elasticache-b" {
#!# # subnet_id = "${aws_subnet.elasticache-b.id}"
#!# #
#!# # route_table_id = "${aws_route_table.az-b.id}"
#!# #}
#!#
#!# resource "aws_route_table_association" "docker-pub-b" {
#!# subnet_id = "${aws_subnet.docker-pub-b.id}"
#!#
#!# #route_table_id = "${module.vpc.public_route_table_id}"
#!# route_table_id = "${aws_route_table.az-b.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "docker-priv-b" {
#!# subnet_id = "${aws_subnet.docker-priv-b.id}"
#!#
#!# route_table_id = "${aws_route_table.az-b.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "app-b" {
#!# subnet_id = "${aws_subnet.app-b.id}"
#!#
#!# route_table_id = "${aws_route_table.az-b.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "admin-b" {
#!# subnet_id = "${aws_subnet.admin-b.id}"
#!#
#!# route_table_id = "${aws_route_table.az-b.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "elb-admin-b" {
#!# subnet_id = "${aws_subnet.elb-admin-b.id}"
#!#
#!# route_table_id = "${aws_route_table.az-b.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "elb-client-b" {
#!# subnet_id = "${aws_subnet.elb-client-b.id}"
#!#
#!# route_table_id = "${aws_route_table.az-b.id}"
#!# }
#!#
#!# #resource "aws_route_table_association" "efs-b" {
#!# # subnet_id = "${aws_subnet.efs-b.id}"
#!# #
#!# # route_table_id = "${aws_route_table.az-b.id}"
#!# #}
#!#
#!# resource "aws_route_table_association" "cmgmt-b" {
#!# subnet_id = "${aws_subnet.cmgmt-b.id}"
#!#
#!# route_table_id = "${module.vpc.public_route_table_id}"
#!# }
resource "aws_nat_gateway" "natgw-b" {
allocation_id = "${aws_eip.natgw-b.id}"
subnet_id = "${aws_subnet.drone-deploy-mgmt-b.id}"
tags {
Name = "${var.name}-natgw-b"
}
}
# create route tables
resource "aws_route_table" "az-b" {
vpc_id = "${module.vpc.vpc_id}"
#propagating_vgws = ["${var.private_propagating_vgws_1}"]
tags {
Name = "${var.name}-rt-natgw-b"
}
}
# create default route for route tables
resource "aws_route" "nategw-b" {
route_table_id = "${aws_route_table.az-b.id}"
destination_cidr_block = "0.0.0.0/0"
nat_gateway_id = "${aws_nat_gateway.natgw-b.id}"
}
# associate AZ routes to AZ NAT route tables
resource "aws_route_table_association" "drone-deploy-mgmt-b" {
subnet_id = "${aws_subnet.drone-deploy-mgmt-b.id}"
route_table_id = "${module.vpc.public_route_table_id}"
}
resource "aws_route_table_association" "elb-b" {
subnet_id = "${aws_subnet.elb-b.id}"
route_table_id = "${module.vpc.public_route_table_id}"
}
#resource "aws_route_table_association" "databases-b" {
# subnet_id = "${aws_subnet.databases-b.id}"
#
# route_table_id = "${aws_route_table.az-b.id}"
#}
#resource "aws_route_table_association" "elasticache-b" {
# subnet_id = "${aws_subnet.elasticache-b.id}"
#
# route_table_id = "${aws_route_table.az-b.id}"
#}
resource "aws_route_table_association" "docker-pub-b" {
subnet_id = "${aws_subnet.docker-pub-b.id}"
#route_table_id = "${module.vpc.public_route_table_id}"
route_table_id = "${aws_route_table.az-b.id}"
}
resource "aws_route_table_association" "docker-priv-b" {
subnet_id = "${aws_subnet.docker-priv-b.id}"
route_table_id = "${aws_route_table.az-b.id}"
}
resource "aws_route_table_association" "app-b" {
subnet_id = "${aws_subnet.app-b.id}"
route_table_id = "${aws_route_table.az-b.id}"
}
resource "aws_route_table_association" "admin-b" {
subnet_id = "${aws_subnet.admin-b.id}"
route_table_id = "${aws_route_table.az-b.id}"
}
resource "aws_route_table_association" "elb-admin-b" {
subnet_id = "${aws_subnet.elb-admin-b.id}"
route_table_id = "${aws_route_table.az-b.id}"
}
resource "aws_route_table_association" "elb-client-b" {
subnet_id = "${aws_subnet.elb-client-b.id}"
route_table_id = "${aws_route_table.az-b.id}"
}
#resource "aws_route_table_association" "efs-b" {
# subnet_id = "${aws_subnet.efs-b.id}"
#
# route_table_id = "${aws_route_table.az-b.id}"
#}
resource "aws_route_table_association" "cmgmt-b" {
subnet_id = "${aws_subnet.cmgmt-b.id}"
route_table_id = "${module.vpc.public_route_table_id}"
}
resource "aws_eip" "natgw-c" {
vpc = true
}
#!# # I don't need no stinking AZs
#!#
#!# resource "aws_eip" "natgw-c" {
#!# vpc = true
#!# }
#!#
#!# resource "aws_nat_gateway" "natgw-c" {
#!# allocation_id = "${aws_eip.natgw-c.id}"
#!# subnet_id = "${aws_subnet.drone-deploy-mgmt-c.id}"
#!#
#!# tags {
#!# Name = "${var.name}-natgw-c"
#!# }
#!# }
#!#
#!# # create route tables
#!# resource "aws_route_table" "az-c" {
#!# vpc_id = "${module.vpc.vpc_id}"
#!#
#!# #propagating_vgws = ["${var.private_propagating_vgws_1}"]
#!#
#!# tags {
#!# Name = "${var.name}-rt-natgw-c"
#!# }
#!# }
#!#
#!# # create default route for route tables
#!# resource "aws_route" "nategw-c" {
#!# route_table_id = "${aws_route_table.az-c.id}"
#!# destination_cidr_block = "0.0.0.0/0"
#!# nat_gateway_id = "${aws_nat_gateway.natgw-c.id}"
#!# }
#!#
#!# # associate AZ routes to AZ NAT route tables
#!# resource "aws_route_table_association" "drone-deploy-mgmt-c" {
#!# subnet_id = "${aws_subnet.drone-deploy-mgmt-c.id}"
#!#
#!# route_table_id = "${module.vpc.public_route_table_id}"
#!# }
#!#
#!# resource "aws_route_table_association" "elb-c" {
#!# subnet_id = "${aws_subnet.elb-c.id}"
#!#
#!# route_table_id = "${module.vpc.public_route_table_id}"
#!# }
#!#
#!# #resource "aws_route_table_association" "databases-c" {
#!# # subnet_id = "${aws_subnet.databases-c.id}"
#!# #
#!# # route_table_id = "${aws_route_table.az-c.id}"
#!# #}
#!#
#!# #resource "aws_route_table_association" "elasticache-c" {
#!# # subnet_id = "${aws_subnet.elasticache-c.id}"
#!# #
#!# # route_table_id = "${aws_route_table.az-c.id}"
#!# #}
#!#
#!# resource "aws_route_table_association" "docker-pub-c" {
#!# subnet_id = "${aws_subnet.docker-pub-c.id}"
#!#
#!# #route_table_id = "${module.vpc.public_route_table_id}"
#!# route_table_id = "${aws_route_table.az-c.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "docker-priv-c" {
#!# subnet_id = "${aws_subnet.docker-priv-c.id}"
#!#
#!# route_table_id = "${aws_route_table.az-c.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "app-c" {
#!# subnet_id = "${aws_subnet.app-c.id}"
#!#
#!# route_table_id = "${aws_route_table.az-c.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "admin-c" {
#!# subnet_id = "${aws_subnet.admin-c.id}"
#!#
#!# route_table_id = "${aws_route_table.az-c.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "elb-admin-c" {
#!# subnet_id = "${aws_subnet.elb-admin-c.id}"
#!#
#!# route_table_id = "${aws_route_table.az-c.id}"
#!# }
#!#
#!# resource "aws_route_table_association" "elb-client-c" {
#!# subnet_id = "${aws_subnet.elb-client-c.id}"
#!#
#!# route_table_id = "${aws_route_table.az-c.id}"
#!# }
#!#
#!# #resource "aws_route_table_association" "efs-c" {
#!# # subnet_id = "${aws_subnet.efs-c.id}"
#!# #
#!# # route_table_id = "${aws_route_table.az-c.id}"
#!# #}
#!#
#!# resource "aws_route_table_association" "cmgmt-c" {
#!# subnet_id = "${aws_subnet.cmgmt-c.id}"
#!#
#!# route_table_id = "${module.vpc.public_route_table_id}"
#!# }
resource "aws_nat_gateway" "natgw-c" {
allocation_id = "${aws_eip.natgw-c.id}"
subnet_id = "${aws_subnet.drone-deploy-mgmt-c.id}"
tags {
Name = "${var.name}-natgw-c"
}
}
# create route tables
resource "aws_route_table" "az-c" {
vpc_id = "${module.vpc.vpc_id}"
#propagating_vgws = ["${var.private_propagating_vgws_1}"]
tags {
Name = "${var.name}-rt-natgw-c"
}
}
# create default route for route tables
resource "aws_route" "nategw-c" {
route_table_id = "${aws_route_table.az-c.id}"
destination_cidr_block = "0.0.0.0/0"
nat_gateway_id = "${aws_nat_gateway.natgw-c.id}"
}
# associate AZ routes to AZ NAT route tables
resource "aws_route_table_association" "drone-deploy-mgmt-c" {
subnet_id = "${aws_subnet.drone-deploy-mgmt-c.id}"
route_table_id = "${module.vpc.public_route_table_id}"
}
resource "aws_route_table_association" "elb-c" {
subnet_id = "${aws_subnet.elb-c.id}"
route_table_id = "${module.vpc.public_route_table_id}"
}
#resource "aws_route_table_association" "databases-c" {
# subnet_id = "${aws_subnet.databases-c.id}"
#
# route_table_id = "${aws_route_table.az-c.id}"
#}
#resource "aws_route_table_association" "elasticache-c" {
# subnet_id = "${aws_subnet.elasticache-c.id}"
#
# route_table_id = "${aws_route_table.az-c.id}"
#}
resource "aws_route_table_association" "docker-pub-c" {
subnet_id = "${aws_subnet.docker-pub-c.id}"
#route_table_id = "${module.vpc.public_route_table_id}"
route_table_id = "${aws_route_table.az-c.id}"
}
resource "aws_route_table_association" "docker-priv-c" {
subnet_id = "${aws_subnet.docker-priv-c.id}"
route_table_id = "${aws_route_table.az-c.id}"
}
resource "aws_route_table_association" "app-c" {
subnet_id = "${aws_subnet.app-c.id}"
route_table_id = "${aws_route_table.az-c.id}"
}
resource "aws_route_table_association" "admin-c" {
subnet_id = "${aws_subnet.admin-c.id}"
route_table_id = "${aws_route_table.az-c.id}"
}
resource "aws_route_table_association" "elb-admin-c" {
subnet_id = "${aws_subnet.elb-admin-c.id}"
route_table_id = "${aws_route_table.az-c.id}"
}
resource "aws_route_table_association" "elb-client-c" {
subnet_id = "${aws_subnet.elb-client-c.id}"
route_table_id = "${aws_route_table.az-c.id}"
}
#resource "aws_route_table_association" "efs-c" {
# subnet_id = "${aws_subnet.efs-c.id}"
#
# route_table_id = "${aws_route_table.az-c.id}"
#}
resource "aws_route_table_association" "cmgmt-c" {
subnet_id = "${aws_subnet.cmgmt-c.id}"
route_table_id = "${module.vpc.public_route_table_id}"
}
......@@ -10,255 +10,115 @@ output "public_route_table_ids" {
value = "${module.vpc.public_route_table_ids}"
}
output "sn-drone-deploy-mgmt-a" {
value = "${aws_subnet.drone-deploy-mgmt-a.id}"
}
output "sn-drone-deploy-mgmt-b" {
value = "${aws_subnet.drone-deploy-mgmt-b.id}"
}
output "sn-drone-deploy-mgmt-c" {
value = "${aws_subnet.drone-deploy-mgmt-c.id}"
}
output "drone-deploy-mgmt-cidr" {
value = [
"${aws_subnet.drone-deploy-mgmt-a.cidr_block}",
"${aws_subnet.drone-deploy-mgmt-b.cidr_block}",
"${aws_subnet.drone-deploy-mgmt-c.cidr_block}",
#"${aws_subnet.drone-deploy-mgmt-b.cidr_block}",
#"${aws_subnet.drone-deploy-mgmt-c.cidr_block}",
]
}
output "sn-drone-deploy-mgmt-a-cidr" {
value = "${aws_subnet.drone-deploy-mgmt-a.cidr_block}"
}
output "sn-drone-deploy-mgmt-b-cidr" {
value = "${aws_subnet.drone-deploy-mgmt-b.cidr_block}"
}
output "sn-drone-deploy-mgmt-c-cidr" {
value = "${aws_subnet.drone-deploy-mgmt-c.cidr_block}"
}
output "sn-elb-a" {
value = "${aws_subnet.elb-a.id}"
}
output "sn-elb-b" {
value = "${aws_subnet.elb-b.id}"
}
output "sn-elb-c" {
value = "${aws_subnet.elb-c.id}"
}
output "sn-efs-a" {
value = "${aws_subnet.efs-a.id}"
}
output "sn-efs-b" {
value = "${aws_subnet.efs-b.id}"
}
output "sn-efs-c" {
value = "${aws_subnet.efs-c.id}"
}
output "sn-databases-a" {
value = "${aws_subnet.databases-a.id}"
}
output "sn-databases-b" {
value = "${aws_subnet.databases-b.id}"
}
output "sn-databases-c" {
value = "${aws_subnet.databases-c.id}"
}
output "sn-elasticache-a" {
value = "${aws_subnet.elasticache-a.id}"
}
output "sn-elasticache-b" {
value = "${aws_subnet.elasticache-b.id}"
}
output "sn-elasticache-c" {
value = "${aws_subnet.elasticache-c.id}"
}
output "sn-docker-pub-a" {
value = "${aws_subnet.docker-pub-a.id}"
}
output "sn-docker-pub-b" {
value = "${aws_subnet.docker-pub-b.id}"
}
output "sn-docker-pub-c" {
value = "${aws_subnet.docker-pub-c.id}"
}
output "sn-docker-priv-a" {
value = "${aws_subnet.docker-priv-a.id}"
}
output "sn-docker-priv-b" {
value = "${aws_subnet.docker-priv-b.id}"
}
output "sn-docker-priv-c" {
value = "${aws_subnet.docker-priv-c.id}"
}
output "sn-app-a" {
value = "${aws_subnet.app-a.id}"
}
output "sn-app-b" {
value = "${aws_subnet.app-b.id}"
}
output "sn-app-c" {
value = "${aws_subnet.app-c.id}"
}
output "sn-admin-a" {
value = "${aws_subnet.admin-a.id}"
}
output "sn-admin-b" {
value = "${aws_subnet.admin-b.id}"
}
output "sn-admin-c" {
value = "${aws_subnet.admin-c.id}"
}
output "sn-cmgmt-a" {
value = "${aws_subnet.cmgmt-a.id}"
}
output "sn-cmgmt-b" {
value = "${aws_subnet.cmgmt-b.id}"
}
output "sn-cmgmt-c" {
value = "${aws_subnet.cmgmt-c.id}"
}
output "cmgmt-cidr" {
value = [
"${aws_subnet.cmgmt-a.cidr_block}",
"${aws_subnet.cmgmt-b.cidr_block}",
"${aws_subnet.cmgmt-c.cidr_block}",
#"${aws_subnet.cmgmt-b.cidr_block}",
#"${aws_subnet.cmgmt-c.cidr_block}",
]
}
output "cmgmt-ids" {
value = [
"${aws_subnet.cmgmt-a.id}",
"${aws_subnet.cmgmt-b.id}",
"${aws_subnet.cmgmt-c.id}",
#"${aws_subnet.cmgmt-b.id}",
#"${aws_subnet.cmgmt-c.id}",
]
}
output "databases-subnets" {
value = [
"${aws_subnet.databases-a.id}",
"${aws_subnet.databases-b.id}",
"${aws_subnet.databases-c.id}",
#"${aws_subnet.databases-b.id}",
#"${aws_subnet.databases-c.id}",
]
}
output "app-subnets" {
value = [
"${aws_subnet.app-a.id}",
"${aws_subnet.app-b.id}",
"${aws_subnet.app-c.id}",
#"${aws_subnet.app-b.id}",
#"${aws_subnet.app-c.id}",
]
}
output "app-subnets-cidr" {
value = [
"${aws_subnet.app-a.cidr_block}",
"${aws_subnet.app-b.cidr_block}",
"${aws_subnet.app-c.cidr_block}",
#"${aws_subnet.app-b.cidr_block}",
#"${aws_subnet.app-c.cidr_block}",
]
}
output "admin-subnets" {
value = [
"${aws_subnet.admin-a.id}",
"${aws_subnet.admin-b.id}",
"${aws_subnet.admin-c.id}",
#"${aws_subnet.admin-b.id}",
#"${aws_subnet.admin-c.id}",
]
}
output "admin-subnets-cidr" {
value = [
"${aws_subnet.admin-a.cidr_block}",
"${aws_subnet.admin-b.cidr_block}",
"${aws_subnet.admin-c.cidr_block}",
#"${aws_subnet.admin-b.cidr_block}",
#"${aws_subnet.admin-c.cidr_block}",
]
}
output "docker-pub-subnets-cidr" {
value = [
"${aws_subnet.docker-pub-a.cidr_block}",
"${aws_subnet.docker-pub-b.cidr_block}",
"${aws_subnet.docker-pub-c.cidr_block}",
#"${aws_subnet.docker-pub-b.cidr_block}",
#"${aws_subnet.docker-pub-c.cidr_block}",
]
}
output "elb-ids" {
value = [
"${aws_subnet.elb-a.id}",
"${aws_subnet.elb-b.id}",
"${aws_subnet.elb-c.id}",
#"${aws_subnet.elb-b.id}",
#"${aws_subnet.elb-c.id}",