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

aws_instances data source #574

Closed
hashibot opened this issue Jun 13, 2017 · 3 comments · Fixed by #2266
Closed

aws_instances data source #574

hashibot opened this issue Jun 13, 2017 · 3 comments · Fixed by #2266
Labels
enhancement Requests to existing resources that expand the functionality or scope.

Comments

@hashibot
Copy link

This issue was originally opened by @mattlqx as hashicorp/terraform#12376. It was migrated here as part of the provider split. The original body of the issue is below.


I would find it useful to have an aws_instances data source that would be able to execute a filter and return the instance IDs of multiple instances. Presently the aws_instance data source says:

NOTE: If more or less than a single match is returned by the search, Terraform will fail. Ensure that your search is specific enough to return a single Instance ID only.

My use-case is that have a Terraform repo that has some common shared infrastructure (like HTTP hosts that hand-out 301s for whatever URL they're given) and I want to attach that to multiple AWS ALBs that are in separate Terraform repos (per application). I would like to do a search on those instances based on tags and be able to use the result list in an aws_alb_target_group_attachment. I'd really like to be able to have an aws_alb_target_group data source, but this is an acceptable (and useful in more ways) alternative.

Right now, the only real way I can get those instances is to hardcode the instance IDs in individual aws_instance data sources. I can work out some outputs where the hosts are created, and work them into being imported into the application Terraforms but this additional layer increases complexity and can become stale or out-of-sync if not done correctly. It's better just to hardcode the IDs for now.

@hashibot hashibot added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 13, 2017
@magnusthorne
Copy link

I need to be able to query AWS for IP addresses by tag. "show me all my jump servers"

@mattlqx
Copy link

mattlqx commented Nov 15, 2017

Thanks so much! Great work!

@ghost
Copy link

ghost commented Apr 10, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants