Integration · Developer
AI agents for HCP Terraform
Work with HCP Terraform (Terraform Cloud): find organizations and workspaces, read runs and their plans, start a plan, then apply, discard or cancel it, and read a workspace's state outputs.
- Actions
- 10
- Read
- 6
- Write
- 4
Actions
What your agents can do in HCP Terraform
Work with HCP Terraform (Terraform Cloud): find organizations and workspaces, read runs and their plans, start a plan, then apply, discard or cancel it, and read a workspace's state outputs, with a user or team API token.
Read 6
Look things up. Nothing changes.
List organizations
Lists the organizations this token can reach, as data: each with id (its name, used by the other actions) and attributes (name, email, created-at).
List workspaces
Lists an organization's workspaces, as data: each with id (ws-…, used by the run actions) and attributes.
Get a workspace by name
Reads one workspace by its organization and name: data.id (ws-…) and data.attributes.
List a workspace's runs
Lists a workspace's runs, newest first, as data: each with id (run-…) and attributes.
Get a run and its plan
Reads one run: data.attributes.status (planning, planned, applying, applied, errored, discarded …), message, has-changes, actions.is-confirmable (can be applied now) and status-timestamps.
Get a workspace's outputs
Reads the outputs of a workspace's current state, as data: each with attributes.name, value, type and sensitive (sensitive values come back as null).
Write 4
Create, change or send.
Start a plan
Queues a run on a workspace with its latest configuration and waits for approval.
Apply a planned runDeletes data
Confirms a run waiting at planned (or policy_checked) so HCP Terraform applies its plan and changes real infrastructure, including destroying the resources the plan removes.
Discard a planned run
Throws away a run waiting for confirmation, so its plan is never applied and the workspace moves on to the next run.
Cancel a running runDeletes data
Interrupts a run that is planning or applying, like Ctrl+C in the Terraform CLI.
A person can approve first
Any write action can be set to wait for a person's approval before it runs, so an agent asks before it changes anything. Actions that delete data ask first by default.
Connection
How it connects
Connect it once in the console, then give it to the agents and workflows that need it.
Paste an API key from your HCP Terraform account.
What you enter
- API token
Settings
- Region
Kept safe
- Credentials are stored encrypted with your organization's own keys.
- They are opened only by the process that makes the call, at the moment it runs, and never go into a prompt or the browser.
- Calls go only to the tool's own servers.
Ideas
Ideas to start with
Starting points made only from the actions above. Mix them with any other tool your agents can use.
- 01
Ask about your HCP Terraform data
Ask a question in plain words. The agent can list organizations, list workspaces or get a workspace by name in HCP Terraform, then answers with what it found.
- 02
Let an agent update HCP Terraform
Have the agent start a plan or cancel a running run in HCP Terraform as part of a larger task. Turn on approval and a person signs off on each change first.
- 03
Share what it finds in Slack
Give one agent HCP Terraform and Slack: it can list organizations in HCP Terraform and post a summary to a Slack channel in the same run.
FAQ
HCP Terraform and MyDeepAgents
Can MyDeepAgents connect to HCP Terraform?
Yes. The HCP Terraform connector has 10 actions: 6 read and 4 make changes. Your agents can call them as tools, and your workflows can run them as steps.
How do I connect HCP Terraform?
Paste an API key from your HCP Terraform account. You'll need: API token. The connection also asks for: Region. Credentials are stored encrypted with your organization's own keys and are opened only at the moment of a call.
Can an agent change data in HCP Terraform without asking?
Only if you let it. Each of the 4 actions that change data can be set to wait for a person's approval before it runs, and the 2 that delete data ask first by default.
Can I use HCP Terraform in workflows as well as agents?
Yes. Every HCP Terraform action also works as a step in a workflow, and the same connection serves your agents and your workflows.
Early access
Put HCP Terraform to work
Connect it in a few minutes, give an agent the actions it needs, and decide which changes wait for a person.