Terraform
HCP Terraform (Terraform Cloud) connector — organizations, projects, workspaces, runs, plans, applies, variables, variable sets, state versions, teams, team access, and run triggers.
Categories: Developer Tools, Infrastructure
📝 Beta: This connector is in beta. It follows the service's documented API but has not yet been fully tested against the live service, so some tools may behave differently than described.
Set up
Terraform connects with credentials from your Terraform account. Have these values ready:
- API token
- Go to Organization > Connectors and find Terraform.
- Click Enable and choose which tools to allow.
- Each member enters their own values the first time they use it.
To use one account for the whole organization, turn on Share one connection with everyone. Every member's agents then act as that account, with exactly the access it has.
Tools
Terraform offers 71 tools. Admins choose which ones agents can use. See Tool permission groups.
Read (35)
View and search information without changing it.
| Tool | What it does |
|---|---|
get_account_details | Get the user or service account the API token authenticates as. |
get_apply | Get one apply's metadata — status and the counts of resources added, changed, and destroyed. |
get_configuration_version | Get one configuration version by ID. |
get_current_state_version | Get a workspace's current (latest) state version. |
get_current_state_version_outputs | Get the outputs of a workspace's current state version — the quickest way to read a workspace's output values. |
get_organization | Get one organization by name. |
get_organization_entitlements | Get the feature entitlement set for an organization — which features (teams, cost estimation, policy enforcement, etc.) its plan includes. |
get_plan | Get one plan's metadata — status and the counts of resources to add, change, and destroy. |
get_plan_json_output | Get planned resource actions from a plan's structured JSON output without attribute values; sensitive values are never returned. |
get_project | Get one project by ID. |
get_run | Get one run by ID, including its status and links to its plan and apply (in relationships). |
get_run_trigger | Get one run trigger by ID. |
get_state_version | Get one state version by ID. |
get_state_version_output | Get one state version output by ID; sensitive output values are always redacted to null by the connector. |
get_team | Get one team by ID. |
get_team_access | Get one team access grant by ID. |
get_variable_set | Get one variable set by ID. |
get_workspace | Get one workspace by ID. |
list_configuration_versions | List a workspace's configuration versions (uploaded Terraform config snapshots), newest first, with pagination. |
list_organization_memberships | List the members of an organization with their user IDs, usernames, and emails. |
list_organization_runs | List runs across an entire organization, newest first, with pagination. |
list_organizations | List the HCP Terraform organizations the API token can access, with pagination. |
list_projects | List projects in an organization, with pagination and an optional name search. |
list_run_comments | List the comments on a run, with pagination. |
list_run_triggers | List a workspace's run triggers, with pagination. |
list_state_version_outputs | List the named outputs of a state version, with pagination. |
list_state_versions | List a workspace's state versions, newest first, with pagination. |
list_team_access | List the teams that have access to a workspace and their access levels, with pagination. |
list_teams | List teams in an organization, with pagination and an optional name search. |
list_variable_sets | List an organization's variable sets, with pagination. |
list_variables_in_variable_set | List the Terraform and environment variables in a variable set. |
list_workspace_runs | List runs in a workspace, newest first, with pagination. |
list_workspace_variables | List all Terraform and environment variables set on a workspace. |
list_workspaces | List workspaces in an organization, newest change first. |
validate_credential | Check that the HCP Terraform API token works by reading the authenticated account. |
Write (11)
Create or send data.
| Tool | What it does |
|---|---|
add_team_access | Grant a team access to a workspace. |
add_team_members | Add members to a team by HCP Terraform username (NOT user ID 'user-...'). |
apply_variable_set_to_workspaces | Apply a variable set to one or more workspaces, so its variables take effect there. |
create_project | Create a project in an organization. |
create_run_comment | Add a comment to a run. |
create_run_trigger | Create a run trigger so a successful apply in the source workspace queues a run in the target workspace. |
create_team | Create a team in an organization. |
create_variable_in_variable_set | Add a variable to a variable set. key and category are required. |
create_variable_set | Create a variable set in an organization. |
create_workspace | Create a workspace in an organization. |
create_workspace_variable | Create a Terraform or environment variable on a workspace. key and category are required; set sensitive=true to hide the value. |
Delete or overwrite (25)
Remove or replace existing data.
| Tool | What it does |
|---|---|
apply_run | Apply a run that has finished planning and is awaiting confirmation. |
cancel_run | Cancel a run that is currently planning or applying, interrupting it. |
create_run | Create (queue) a run on a workspace from its latest configuration or a given configuration_version_id; set is_destroy for a teardown or plan_only for a speculative plan. |
delete_project | Delete a project. |
delete_run_trigger | Delete a run trigger. |
delete_team | Delete a team. |
delete_variable_in_variable_set | Remove a variable from a variable set. |
delete_variable_set | Delete a variable set. |
delete_workspace | Delete a workspace and everything in it, without checking whether it still manages resources — this can orphan live infrastructure. |
delete_workspace_variable | Delete a variable from a workspace. |
discard_run | Discard a run awaiting confirmation, abandoning its plan without applying. |
force_unlock_workspace | Force-unlock a workspace locked by another user or a stuck run. |
lock_workspace | Lock a workspace so no new runs can start. |
move_workspaces_to_project | Move one or more workspaces into a project. |
remove_team_access | Remove a team's access to a workspace. |
remove_team_members | Remove members from a team by HCP Terraform username (NOT user ID 'user-...'). |
remove_variable_set_from_workspaces | Remove a variable set from one or more workspaces. |
safe_delete_workspace | Delete a workspace only if it manages no resources; HCP Terraform refuses the call otherwise, so this cannot orphan live infrastructure. |
unlock_workspace | Unlock a workspace you hold the lock on, re-enabling runs. |
update_project | Update a project's name or description. |
update_team | Update a team's name, visibility, or organization access. |
update_team_access | Update a team's access level on a workspace. |
update_variable_set | Update a variable set's name, description, global flag, or priority. |
update_workspace | Update a workspace's settings (name, description, execution_mode, terraform_version, working_directory, auto_apply). |
update_workspace_variable | Update a workspace variable's value, key, description, category, or flags. |