-
Notifications
You must be signed in to change notification settings - Fork 164
Support multiple team tokens for a single team with tfe_team_token
#1698
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
base: main
Are you sure you want to change the base?
Conversation
tfe_team_token
e2bb093
to
ccfd721
Compare
30d2ada
to
00d0b73
Compare
By setting the description, this allows for creation of multiple team tokens.
Previously, when a team only had a single token, it was sufficient to have the ID of the token be set to the team ID. Now that we support multiple team tokens, we should use the token ID instead. We will continue to use the team ID for descriptionless tokens so that it is backwards compatible, though.
00d0b73
to
bdc8aec
Compare
go.mod
Outdated
@@ -14,7 +14,7 @@ require ( | |||
github.com/hashicorp/go-multierror v1.1.1 // indirect | |||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect | |||
github.com/hashicorp/go-slug v0.16.5 | |||
github.com/hashicorp/go-tfe v1.78.0 | |||
github.com/hashicorp/go-tfe v1.78.1-0.20250418170002-da71abb96c5a |
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.
I assume this is just to get nil Description support?
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.
Yes, that's correct!
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.
I think this is looking and behaving very well. I smoke-tested import and different combinations of adding/removing descriptions and force_regenerate. It works as documented.
When does your feature reach GA? That would probably be the time to merge this PR.
@brandonc Thanks for taking a look! The plan is to GA for HCP Terraform this upcoming Monday, and then hopefully have it included in next TFE release ( |
Description
This PR adds support to create multiple team tokens for a single team using
tfe_team_token
by adding thedescription
attribute. If no description is provided, it follows the previous behavior oftfe_team_token
, which uses the old team token API that assumes there is only one token per team.Some other notable differences:
force_regenerate
cannot be used whendescription
is set.team-
vs.at-
)Also, adding support for creating multiple ephemeral team tokens is out of scope for this PR. This will be added in a separate, follow-up PR.
This feature is not GA yet, so I've labeled this PR as "do not merge" for now.Testing plan
Output from acceptance tests
Test results with beta enabled
Output from documentation preview
Docs changes