-
Notifications
You must be signed in to change notification settings - Fork 103
[IPL-7725] Adding Support for Calls to /workspaces/{external_id}/all-vars
API Endpoint on HCP Terraform
#1105
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
Conversation
…ed with a workspace including variables that inherited from organization and/or project variable sets. The List API does not include variables that are inherited from varsets but not overwritten in the workspace.
…-vars API and adding integration tests
for /api/v2/workspaces/{id}/all-vars API
for /api/v2/workspaces/{id}/all-vars API
/workspaces/{external_id}/all-vars
Endpoint on HCP Terraform
/workspaces/{external_id}/all-vars
Endpoint on HCP Terraform/workspaces/{external_id}/all-vars
API Endpoint on HCP Terraform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
CHANGELOG.md
Outdated
@@ -28,6 +28,8 @@ | |||
|
|||
* Add BETA support for use of OPA and Sentinel with Linux arm64 agents, which is EXPERIMENTAL, SUBJECT TO CHANGE, and may not be available to all users @natalie-todd [#1090](https://github.com/hashicorp/go-tfe/pull/1090) | |||
|
|||
* Add support for HCP Terraform `/api/v2/workspaces/{external_id}/all-vars` API endpoint to fetch the list of all variables available to a workspce (include inherited variables from varsets) by @debrin-hc [#1105](https://github.com/hashicorp/go-tfe/pull/1105) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be moved to the Unreleased version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Reminder to the contributor 95FF that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes. |
Description
This PR adds the support to make calls to the
/workspaces/{external_id}/all-vars
V2 API, which now returns the list of all variables accessible in a workspace. This list now includes all variables inherited from organization and project level variable sets in HCP Terraform. The existing V2 API/workspaces/{external_id}/vars
only returns the list of variables defined in a workspace, and excludes inherited but not overwritten variables from varsets.With this change, the remote / backend context in terraform core can effectively call this API to fetch the list of accessible variables, effectively fixing the bug mentioned in IPL-7725. The bug talks about such inherited but not overwritten variables defined in a terraform configuration, which causes a "No value for required variable" error while doing a
terraform import
from the CLI.Testing plan
External links
Output from tests
Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.
Rollback Plan
Not required. This adds support for a new V2 API and does not affect any existing workflows.