go-tfe
go-tfe copied to clipboard
[Feature Request] Add filter options when listing Terraform Versions
Terraform Versions have several attributes that can be filtered on:
- official (true or false)
- enabled (true or false)
- beta (true or false)
- usage (when 0 or non zero)
Suggesting adding these filters to the List() function -> https://github.com/hashicorp/go-tfe/blob/0f08d6bfbd92d4302a76a506d423976bb0535322/admin_terraform_version.go#L66
This would be great, but note that they can't currently be filtered on in the API, so the platform would have to add that before anything can be done for that here. I would suggest creating a field request for this as this issue tracker does not get reviewed for potential API additions to the platform.
Thanks @chrisarcand!
I thought this worked however checking again, you are correct, the enabled=true
flag does not actually do anything when added to the query string :)
@straubt1 Hi Tom! We have recently added a filtering and searching functionality for listing terraform versions with go-tfe. Here is documentation for how to use those new query params: https://www.terraform.io/cloud-docs/api-docs/admin/terraform-versions#query-parameters Now I know this not exactly the feature you requested on this Github Issue, but I thought perhaps this new functionality could be helpful to the use case you have in mind 🤞. If this doesn't help for filtering/searching for enabled, official or beta versions the way you wanted, I'd be great if you can provide me with more details on the use cases that you'd be solving for by having a boolean for additional attributes. I appreciate the feedback!
I reached out to @straubt1 in Slack to find out if there are any remaining issues for this issue.
Talking with @straubt1 and it sounds like the hope is that the feature could be available in the SDK one day and not just in the API, so I'll leave this open.