scottslowe-learning-tools/traefik/compute.tf
Scott Lowe db91b58b0b
Work on Swarm/AWS infrastructure setup
Fine-tune the Terraform configurations. Rework the Docker Compose file for deploying containers onto the swarm cluster.

Environment is still non-functional.

Signed-off-by: Scott Lowe <scott.lowe@scottlowe.org>
2017-09-09 10:43:55 -06:00

33 lines
1.4 KiB
HCL

# Launch a Fedora Atomic Host 26 instance to serve as a manager
resource "aws_instance" "manager" {
ami = "${data.aws_ami.f26_atomic_ami.id}"
instance_type = "${var.mgr_flavor}"
key_name = "${var.keypair}"
vpc_security_group_ids = ["${aws_security_group.mgmt_sg.id}"]
subnet_id = "${aws_subnet.traefik_pub_subnet.id}"
depends_on = ["aws_internet_gateway.traefik_gw"]
tags {
Name = "manager"
tool = "terraform"
demo = "traefik"
area = "compute"
role = "manager"
}
}
# Launch some Fedora Atomic Host 26 instances to serve as worker nodes
resource "aws_instance" "worker" {
ami = "${data.aws_ami.f26_atomic_ami.id}"
count = "${var.num_wkr_nodes}"
instance_type = "${var.wkr_flavor}"
key_name = "${var.keypair}"
vpc_security_group_ids = ["${aws_security_group.web_sg.id}"]
subnet_id = "${aws_subnet.traefik_pub_subnet.id}"
depends_on = ["aws_internet_gateway.traefik_gw"]
tags {
tool = "terraform"
demo = "traefik"
area = "compute"
role = "worker"
}
}