Prerequisites
- An HCP Terraform organization on app.terraform.io. Terraform Enterprise isn’t supported.
- You, or someone helping you, must be an owner of that organization, because only owners can create or revoke the organization token.
- The Admin role in the CloudThinker workspace, which you need to add connections. See Roles.
An organization token has authority across the whole organization. CloudThinker limits itself to the actions on this page, but treat the token as an organization-wide secret.
Setup
1
Copy your organization name
Sign in to HCP Terraform, select the organization, and copy its name exactly as shown, for example
platform-team.2
Create the organization token
Open Organization settings → API Tokens → Organization Tokens, set an expiration (the shortest your policy allows, and note the date), generate the token, and copy it right away. HCP Terraform shows it only once.
3
Add the connection in CloudThinker
Open Settings → Workspace → Connections, select HCP Terraform, enter the Organization name and Organization token, and click Connect. CloudThinker checks that the token belongs to that organization.Success state: the connection shows a Connected status.
Connection details
Each CloudThinker workspace holds one HCP Terraform connection, so it covers one organization. To cover a second organization, connect it in another CloudThinker workspace.
Required permissions
Use the organization token, not a user or team token. HCP Terraform organization tokens can manage workspaces but can’t start runs or upload configuration versions, which matches what this connection does.Agent capabilities
CloudThinker states the scope it read in every answer. Changes address a workspace by name, so you can lock or rename one outside the first 100 by naming it. Run status describes Terraform runs, not the health of your infrastructure.
What this connection can’t do
It can’t start plans, applies, or runs. It can’t upload or download configuration or state, change variables, show sensitive outputs, force-unlock or force-delete a workspace, delete an organization, manage teams or tokens, or connect to Terraform Enterprise endpoints. Ask for a run and CloudThinker reports current run state, says it changed nothing, and stops.Verify the connection
Scope: first 100 workspaces.
Example prompts
Write access
Before any workspace change, CloudThinker names the organization, workspace, action, and expected effect in the approval request. Asking for the change in your prompt doesn’t count as approval. Every change an agent makes goes through your workspace’s Approvals first. On the default Auto · Rules + AI · Ask me mode, AI judgment can let a safe change run without asking — and an Allow Rule can too. Choose Manual to approve every change yourself. HCP Terraform records each change under the organization token, not a person. A lock carries the reasonCloudThinker approved workspace lock.
Safe delete uses HCP Terraform’s own safe-delete action, which refuses a workspace that still manages resources. CloudThinker never force-deletes.
Troubleshooting
"Invalid HCP Terraform organization name"
"Invalid HCP Terraform organization name"
Enter the name exactly as shown in HCP Terraform. Don’t paste the organization URL or an HCP organization ID.
"HCP Terraform organization token is invalid or expired"
"HCP Terraform organization token is invalid or expired"
Create a replacement organization token, update Organization token, and reconnect. Coordinate with the owners first, because the old token stops working.
"HCP Terraform organization was not found or the token cannot access it"
"HCP Terraform organization was not found or the token cannot access it"
Organization name and Organization token must come from the same organization. Fix whichever is wrong and reconnect.
"HCP Terraform token resolved a different organization"
"HCP Terraform token resolved a different organization"
The token belongs to another organization. Enter that organization’s name, or use the token from the organization you entered.
"HCP Terraform API rate limit reached. Retry later"
"HCP Terraform API rate limit reached. Retry later"
Wait a few minutes, then reconnect once. Repeated retries keep you rate limited.
Safe delete refused a workspace
Safe delete refused a workspace
The workspace still manages resources. Remove that infrastructure through your normal Terraform workflow first, then ask again.
Security
- Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
- Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
- Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
- Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
- Track expiration. Replace the token before the expiration date you set in setup.
- Coordinate rotation. Only one organization token is valid at a time. Confirm which integrations use it before you generate or revoke one.
Related
Approvals
Control how CloudThinker asks before a workspace change.
Pulumi connection
Connect your other infrastructure-as-code service.