Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance_ids output elements are a tuple after 0.12 migration #23

Open
zandrei opened this issue Jun 18, 2020 · 0 comments
Open

Instance_ids output elements are a tuple after 0.12 migration #23

zandrei opened this issue Jun 18, 2020 · 0 comments

Comments

@zandrei
Copy link

zandrei commented Jun 18, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant