terraform-community-modules/tf_aws_nat

Instance_ids output elements are a tuple after 0.12 migration

zandrei opened this issue · 0 comments

Hello,
We have configured the NAT module like this:
module "nat" {
source = "github.com/terraform-community-modules/tf_aws_nat"
name = "nat-test-${var.environment_tag}"
instance_type = "t2.nano"
instance_count = "1"
aws_key_name = var.key_name
public_subnet_ids = [aws_subnet.public-subnet.id]
private_subnet_ids = [aws_subnet.subnet-backend[0].id, aws_subnet.subnet-backend[1].id]
vpc_security_group_ids = [aws_security_group.nat.id]
az_list = [data.aws_availability_zones.available.names[0]]
subnets_count = "1"
ssh_bastion_user = "user"
ssh_bastion_host = aws_instance.bastion.public_ip
aws_private_key = file(var.private_key_path)
}

In terraform 11, we would be able to access the single nat instance with ${module.nat.instance_ids[0]} . Since the 0.12 upgrade, terraform would output an error for this in the sense that this value "is a tuple with 1 element" instead of a single string value. The workaround was to have it like element("${module.nat.instance_ids[0]}",0) to access the single instance id

Let me know if you need further details.