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

Add new resource tfe_agent_token #259

Merged
merged 5 commits into from
Jan 21, 2021

Conversation

jgrumboe
Copy link
Contributor

@jgrumboe jgrumboe commented Jan 17, 2021

Description

This PR adds a new tfe_agent_token resource that can be used to create agent tokens using the Agent Tokens API endpoint.

This PR depends on PR hashicorp/go-tfe#169 in the hashicorp/go-tfe repository, which added the files agent_token.go and associated agent_token_test.go to interact with the above API endpoint.

Closes #250.

Testing plan

The new tfe_agent_token resource can be tested with this command after following the setup instructions in TESTS.md:

TESTARGS="-run TestAccTFEAgentToken" make testacc

However, testing prior to the merging of hashicorp/go-tfe#169 and issuing a new release of go-tfe would require you to build go-tfe locally from https://github.com/jgrumboe/go-tfe/tree/jgrumboe-agent-token and then add a line like replace github.com/hashicorp/go-tfe => /path-to-local-repo/go-tfe to go.mod above the required stanza.

External links

Output from acceptance tests

TESTARGS="-run TestAccTFEAgentToken" make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run TestAccTFEAgentToken -timeout 15m
?       github.com/hashicorp/terraform-provider-tfe     [no test files]
=== RUN   TestAccTFEAgentToken_basic
--- PASS: TestAccTFEAgentToken_basic (31.41s)
PASS
ok      github.com/hashicorp/terraform-provider-tfe/tfe 31.675s
?       github.com/hashicorp/terraform-provider-tfe/version     [no test files]

Copy link
Member

@chrisarcand chrisarcand left a comment

Choose a reason for hiding this comment

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

This looks great! Just needs a few last minute bits:

go.mod Outdated Show resolved Hide resolved
tfe/resource_tfe_agent_token.go Outdated Show resolved Hide resolved
@chrisarcand
Copy link
Member

Build's failing because of #263

@chrisarcand chrisarcand merged commit 079c859 into hashicorp:master Jan 21, 2021
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.

Add tfe_agent_pool_token resource
2 participants