-
Notifications
You must be signed in to change notification settings - Fork 154
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
Use org memberships for teams #154
Conversation
Updated go.mod to use go-tfe 0.6.0. Re-tested locally:
|
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'm not super familiar with this part of the api but the code makes sense and the example config worked for apply/destroy.
i did notice one weird thing and i just want a little clarification on it before i hit approve. is it expected that a user managed this way changing their email address would mess things up? i suspect the answer is yes, since we are using an attribute that can be changed to identify team members.
i ran apply with the example config, accepted the invitation and created a new account. i then changed the email address on my new account and tried to run an apply again. this apply basically invited a new user and added them back to the team. so the management of the original user is kind of lost now.
if we do expect this behavior and there isn't a different solution, we might want to add something to the docs explaining what to expect/recommendations in this case.
.circleci/config.yml
Outdated
@@ -11,6 +11,7 @@ jobs: | |||
- image: circleci/golang:1.11.13 | |||
environment: | |||
TEST_RESULTS_DIR: *test_results_dir | |||
GO111MODULE: "on" |
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.
just for my own knowledge because i still don't understand what this does: what's the impact of turning this on here? like what does it change/do?
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.
Line 16 of this config sets the working directory to a folder within the GOPATH
:
/go/src/github.com/terraform-providers/terraform-provider-tfe
GO111MODULE
defaults to "auto"
which for Go 1.11 and 1.12 means not using go modules when inside the Go path (but changes with 1.13 to using modules while inside the Go path). We are using modules to track our dependencies and have been updating the vendor directory but with this flag set it is not necessary to continue to vendor these dependencies in the vendor folder.
I will vendor the dependency and take this out.
Allows adding a user to a team through the organization membership resource.
* Add docs for organization_membership * Add docs for team_organization_member * Change notes on team_member and team_members to suggest that team_organization_member is the preferred resource for managing team membership.
9dac5dc
to
2711a52
Compare
@lafentres added:
|
TODO
changelog.md
Description
This PR adds the
tfe_organization_membership
andtfe_team_organization_member
resource. These resources in combination eliminate some of the back and forth required to get a new team member setup. You no longer need to have the user sign up and send you their username in order to manage their team memberships.tfe_organization_membership
This resource is the equivalent of inviting a user by email address to the organization, without specifying any teams.
tfe_team_organization_member
This resource allows you to add an invited user to a team. The advantage of using this over something like
tfe_team_member
ortfe_team_members
(both of which require usernames to identify the user) is that you can manage the teams an invited user is on before the user has accepted the invitation.Requirements
While this PR doesn't introduce a breaking change, it does introduce two new resources which require that the provider be configured to use Terraform Cloud or an instance of Terraform Enterprise at least as new as v202004-1, which is not yet released.
Testing plan
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 the full suite of acceptance tests locally and include the output here.