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 #12376

Closed
mattlqx opened this issue Mar 2, 2017 · 2 comments
Closed

aws_instances data source #12376

mattlqx opened this issue Mar 2, 2017 · 2 comments

Comments

@mattlqx
Copy link

mattlqx commented Mar 2, 2017

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.

artburkart pushed a commit to artburkart/terraform that referenced this issue Mar 12, 2017
I think this PR includes most of the work required to make aws_instances
work, except I'm stuck on a bug that is probably very simple and easy
to decipher. For some reason, the "instances" field on my resource doesn't
exist when it comes time to `terraform apply`. When this PR is complete, it
should close [Issue 12376](hashicorp#12376).
artburkart pushed a commit to artburkart/terraform that referenced this issue Mar 18, 2017
artburkart pushed a commit to artburkart/terraform that referenced this issue Mar 18, 2017
@vaygr
Copy link

vaygr commented Apr 10, 2017

I second this.

@ghost
Copy link

ghost commented Apr 9, 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 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.

@ghost ghost locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants