Skip to content

Instantly share code, notes, and snippets.

@pll
pll / gist:52dcb7ca69e7b0f962cc
Created July 16, 2015 20:34
using count/count.index to spin up multiple instances with EIPs.
######################################################################
## Set up NAT instances
###
resource "aws_instance" "nat" {
ami = "${var.aws_nat_ami}"
count = 2
associate_public_ip_address = true
availability_zone = "${lookup(var.az, count.index)}"
instance_type = "t2.micro"
key_name = "${var.aws_key_name}"