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_agent_token ephemeral resource #1627

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

uturunku1
Copy link
Collaborator

@uturunku1 uturunku1 commented Feb 28, 2025

Description

Allow users to create an ephemeral resource for tfe_agent_token, so that agent pool tokens are 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_agent_pool" "foobar" {
  name         = "agent-pool-test"
  organization = "hashicorp"
}

ephemeral "tfe_agent_token" "this" {
  agent_pool_id = tfe_agent_pool.foobar.id
  description   = "my description"
}

output "my-agent-token" {
  value       = ephemeral.tfe_agent_token.this.token
  description = "Token for tfe agent."
  ephemeral   = true
}

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

External links

Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.

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 TestAccTFEWorkspace" make testacc

...

ctrombley and others added 2 commits February 26, 2025 18:07
So that agent pool tokens are not stored in the Terraform state file and can be handled securely and temporarily during Terraform operations
@uturunku1 uturunku1 changed the title Ephemeral agent token feat: add tfe_agent_token ephemeral resource Feb 28, 2025
@uturunku1 uturunku1 marked this pull request as ready for review February 28, 2025 19:45
@uturunku1 uturunku1 requested a review from a team as a code owner February 28, 2025 19:45
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.

2 participants