You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 theaws_instance
data source says: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 anaws_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.The text was updated successfully, but these errors were encountered: