Terraform: How to associate newly created AWS Subnets with Routing Table as a list ,currently "Routing table association" supports only a String variable

Created on 27 May 2017  ยท  3Comments  ยท  Source: hashicorp/terraform

How to associate newly created AWS Subnets with Routing Table as a list ,currently "Routing table association" supports only a String variable

Terraform Version

MAC OS : Terraform v0.9.6

question

Most helpful comment

using count

something like this

resource "aws_route_table_association" "public" {
    count = "${length(aws_subnet.public.*.id)}"
    subnet_id = "${element(aws_subnet.public.*.id, count.index)}"
    route_table_id = "${aws_route_table.public.id}"
}

All 3 comments

using count

something like this

resource "aws_route_table_association" "public" {
    count = "${length(aws_subnet.public.*.id)}"
    subnet_id = "${element(aws_subnet.public.*.id, count.index)}"
    route_table_id = "${aws_route_table.public.id}"
}

Hello! :robot:

We use GitHub issues for tracking bugs and enhancements rather than for questions. While we can sometimes help with certain simple problems here, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by our few core maintainers.

Since this issue doesn't represent a specific bug or feature request, I'm going to close it. Please do feel free to ask your question in the community forum. Thanks!

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darron picture darron  ยท  3Comments

thebenwaters picture thebenwaters  ยท  3Comments

ronnix picture ronnix  ยท  3Comments

rjinski picture rjinski  ยท  3Comments

c4milo picture c4milo  ยท  3Comments