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

Data sources could benefit from distinct singular or plural instances for usability #431

Open
jakauppila opened this issue Jan 10, 2025 · 0 comments

Comments

@jakauppila
Copy link

The current behavior of providing filter criteria on a data source and getting a results object with (potentially) multiple results is cumbersome and actually problematic in situations where we only want a single result back yet no way to validate that.

It would be great if there were singular and plural data sources that returned a single object or an array of objects, respectively.

At that point, rather than the object being returned in a "results" sub-object, the attributes should be accessible from the top level.

It would be similar to how aws_security_group and aws_security_groups within the AWS Terraform provider operates today.

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/security_group
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/security_groups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant