mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
Commit a set of Terraform configurations that support multi-AZ deployments Signed-off-by: Scott Lowe <scott.lowe@scottlowe.org>
15 lines
637 B
HCL
15 lines
637 B
HCL
# Launch instances across subnets/AZs
|
|
resource "aws_instance" "node" {
|
|
count = "${var.num_nodes}"
|
|
ami = "${data.aws_ami.node_ami.id}"
|
|
instance_type = "${var.node_type}"
|
|
key_name = "${var.key_pair}"
|
|
vpc_security_group_ids = ["${aws_vpc.demo_vpc.default_security_group_id}"]
|
|
subnet_id = "${element(aws_subnet.demo_subnet.*.id, count.index)}"
|
|
tags {
|
|
Name = "node-${count.index}"
|
|
tool = "terraform"
|
|
demo = "terraform"
|
|
area = "compute"
|
|
}
|
|
}
|