Terraform Cloud
Connect Terraform Cloud (HCP Terraform) to Ploy to see who is in your Terraform Cloud organization and which teams they belong to, invite and remove people, and add or remove people on teams.
This integration is in beta
Terraform Cloud is a beta integration. It was built from Terraform Cloud's API documentation and has not yet been run against a customer organization, so the first scans are checked by the Ploy team.
The first step of setup is a consent checkbox. Ticking it lets Ploy record redacted error details when Terraform Cloud answers a request with an error. Redacted means names, email addresses, tokens and other personal or secret values are removed before anything is stored. Ploy uses these details only to fix the integration.
What you need
A Terraform Cloud organization on app.terraform.io. Self-hosted Terraform Enterprise is not supported yet.
A member of the organization's owners team, to create the API token.
Step 1: Create an API token
Use a token that belongs to the owners team:
a user API token of a member of the owners team (in Terraform Cloud, open Account settings, then Tokens, then Create an API token), or
the owners team's own token (Organization settings, then Teams, then owners, then Team API token).
Owners can see every team, including secret teams, and can invite and remove members. A token from someone outside the owners team cannot see secret teams, so Ploy would show less access than really exists.
Copy the token when it is shown: Terraform Cloud does not show it again. Note when it expires and replace it in Ploy before then.
Step 2: Connect Terraform Cloud in Ploy
In Ploy, open Integrations, find Terraform Cloud and select Connect.
Tick the beta consent checkbox.
Enter your organization name as it appears in Terraform Cloud addresses. For example, for
app.terraform.io/app/acmeenteracme.Paste the API token and continue.
Choose the team new people join. Terraform Cloud only invites someone into at least one team, so when Ploy invites a person they join this team. Pick the team with the least access you are happy to give everyone. The owners team is not offered. Leave it empty if Ploy should not invite people.
Select Test connection, then save.
One connection covers one organization. Add another connection for each further organization.
What Ploy reads
Members: everyone in the organization, including people who were invited and have not accepted yet. Invited people are shown as invited and count as having access, because an invitation holds a seat.
Two-factor authentication: whether each member has it turned on.
Teams: every team and who is in it. In Terraform Cloud, access to workspaces and projects is only ever given to teams, so team membership is how access is managed.
The organization itself, as a resource each member has access to.
Ploy scans every six hours. Terraform Cloud has no suspended state, so someone removed from the organization loses their access in Ploy on the next scan.
What Ploy can change
Invite a person by email into the team chosen in step 2. Someone already in the organization is left as they are.
Remove a person from the organization. This also takes them out of every team. Their Terraform Cloud account itself stays.
Add or remove a person on a team, from the team's page in Ploy. People must accept their invitation before they can join a team.
Good to know
Which workspaces and projects each team can reach is not shown yet.
Teams whose membership is managed by single sign-on group mapping may be changed back by your identity provider on its next sync.
Ploy does not read Terraform Cloud's audit trail, and does not create teams or revoke API tokens.
If the token expires or is deleted, scans stop and Ploy shows the connection as needing attention. Create a new token and update the connection.