-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Using splats with outputs #2821
Comments
This would also be invaluable with modules that generate an unknown amount of resources, as you have to define the outputs ahead of time. For example, I have a module that generates any number of EC2 instances. Being able to output all their ips would be brilliant so I can reference them in the root module. |
I am also running into this issue. I have a module which defines our standard instance layout and want to have an output which lists all instances. But using the splat syntax only gives me one of the two created instances. Have you found a solution in the meantime? |
Interesting idea! We'll have to give it some thought. In the meantime, you can work around this by using output "public_subnet_ids" {
value = "${join(",", aws_subnet.public.*.id)}"
} |
@phinze derp. Great solution! |
The workaround I submitted is the valid way to do this today - once list support lands in 0.7 this will be a first class feature and not require |
wahoo! thanks @phinze! |
@phinze this is still broken in 0.7
results in |
My bad using the following syntax works (some documentation about this should be nice :))
|
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. |
Good day, all!
I've tried to get the following functionality to work, but I'm not sure terraform has the ability to do this yet. Let's say we have a resource:
I know it's possible to reference it in an output like so:
But I'd love to be able to reference all of them automatically:
I couldn't find anything issues/PR's wise. Has this been thought about at all?
The text was updated successfully, but these errors were encountered: