Problem
Users of certain versions of Terraform Enterprise may experience issues with API filtering attributes not working as expected. For example, when calling the List Workspaces API and using the following filter yet the API does not appear to respect the filter when it outputs the results showing all workspace statuses instead of the filtered status only.
curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
"https://<TFE_URL>/api/v2/workspaces/ws-KgwBndLB7gc5wo5C/
runs?filter%5Bstatus%5D=discarded&fields%5Brun%5D%5B%5D=status" | jq '.'
Cause
- Known versions of Terraform Enterprise that does not honor API filtering is the July 2022 releases
v202207-1
andv202207-2
.
Solution:
- Recommendation is to upgrade Terraform Enterprise to the latest version possible.
Additional Information
-
Should you still encounter issues with using API filtering on the latest version, please contact support for assistance.