Skip to content

Instance_ids output elements are a tuple after 0.12 migration #23

Description

@zandrei

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions