Skip to content

Conversation

arybolovlev
Copy link
Contributor

Description

This PR adds Variables to the Workspace relations.

$ curl -s \
  --header "Authorization: Bearer $TFE_TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request GET \
"https://app.terraform.io/api/v2/workspaces/ws-XXX" | jq
    "relationships": {
      ...
      "vars": {
        "data": [
          {
            "id": "var-xh8w2W4bZJ3X4HH9",
            "type": "vars"
          },
          {
            "id": "var-PStyaxTNYWszMBoy",
            "type": "vars"
          }
        ]
      }
      ...
    }

Testing plan

N/A.

External links

Relations are purely documented in the API doc, however, vars are mentioned there one.

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.

$ TFE_ADDRESS="https://app.terraform.io/" TFE_TOKEN="X.atlasv1.X" go test ./... -v -run TestVariablesCreate$

PASS
ok  	github.com/hashicorp/go-tfe	5.293s

@arybolovlev arybolovlev requested a review from a team as a code owner March 19, 2024 09:33
Copy link
Contributor

@Maed223 Maed223 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good 👍– only thing missing is the Changelog entry.

@arybolovlev
Copy link
Contributor Author

Code looks good 👍– only thing missing is the Changelog entry.

Added a changelog. Thank you!

@arybolovlev arybolovlev requested a review from Maed223 March 20, 2024 10:07
@arybolovlev arybolovlev merged commit 660355c into main Mar 21, 2024
@arybolovlev arybolovlev deleted the add-workspace-variables-relation branch March 21, 2024 15:08
Copy link

Reminder to the contributor 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.

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

Successfully merging this pull request may close these issues.

3 participants