Skip to content
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

feat: add tfe_team_token ephemeral resource #1628

Merged

Conversation

shwetamurali
Copy link
Contributor

@shwetamurali shwetamurali commented Feb 28, 2025

Description

Allow users to create an ephemeral resource for tfe_team_token, so that the org token is not stored in the Terraform state file and can be handled securely and temporarily during Terraform operations.

Remember to:

Testing plan

  1. Create a terraform configuration that has child module
  2. In that module, try out a config similar to this:
resource "tfe_team" "example" {
  organization = "my-org-name"
  name = "team-test"
}

ephemeral "tfe_team_token" "example" {
  team_id = tfe_team.example.id
}

output "my-team-token" {
  value       = ephemeral.tfe_team_token.this.token
  ephemeral   = true
}

Then init and apply the configuration.
The state file should not include the ephemeral resource.

Output from acceptance tests

Please run applicable acceptance tests locally and include the output here. See testing.md to learn how to run acceptance tests.

If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.

$ TESTARGS="-run TestAccTeamTokenEphemeralResource" make testacc

...

@ctrombley ctrombley force-pushed the TF-23087-implement-ephemeral-resource-for-tfe-team-token branch from ceba3c8 to 8724c52 Compare March 5, 2025 21:46
@ctrombley ctrombley self-assigned this Mar 5, 2025
@ctrombley ctrombley marked this pull request as ready for review March 5, 2025 21:48
@ctrombley ctrombley requested a review from a team as a code owner March 5, 2025 21:48
@ctrombley ctrombley changed the title add ephemeral resource and test add ephemeral resource tfe_team_token Mar 5, 2025
uturunku1
uturunku1 previously approved these changes Mar 6, 2025
Copy link
Contributor

@uturunku1 uturunku1 left a comment

Choose a reason for hiding this comment

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

We are just missing the release note, but it works great!

@ctrombley ctrombley force-pushed the TF-23087-implement-ephemeral-resource-for-tfe-team-token branch from 4dcf989 to 493c819 Compare March 7, 2025 01:45
@ctrombley
Copy link
Contributor

We are just missing the release note, but it works great!

Updated in 493c819.

@ctrombley ctrombley requested a review from uturunku1 March 7, 2025 01:49
@ctrombley ctrombley changed the title add ephemeral resource tfe_team_token feat: add tfe_team_token ephemeral resource Mar 7, 2025
@ctrombley ctrombley merged commit 3d360ac into main Mar 7, 2025
5 checks passed
@ctrombley ctrombley deleted the TF-23087-implement-ephemeral-resource-for-tfe-team-token branch March 7, 2025 18:13
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