resource "aws_instance" "test" { count = local.test_instances ami = data.aws_ami.ubuntu.id instance_type = "t3.micro" associate_public_ip_address = true key_name = "fred-ed25519" subnet_id = module.vpc.public_subnets[count.index % 2] vpc_security_group_ids = [aws_security_group.allow_all.id] tags = merge(local.tags, { "index" : count.index }) }