The HCP Terraform connector lets your AI agent act in each user's HCP Terraform account. Each user connects their own HCP Terraform access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 30 tools.
- Tools
- 30
- What they doRead · write · destructive
- 17 · 11 · 217 read11 write2 destructive
- Users sign in with
- Access token
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the HCP Terraform connection
In AgentKit > Connections, create a HCP Terraform connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'terraform'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize HCP Terraform:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'terraform_organizations_list',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "terraform"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize HCP Terraform:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="terraform_organizations_list",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their HCP Terraform credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolterraform_organization_getGet one HCP Terraform organization by name.Read-onlyGet Organization
Get one HCP Terraform organization by name. Returns its settings: email, default execution mode, collaborator auth policy, cost estimation, session settings and the token's permissions on it. Use terraform_organization_get for a known name. Use terraform_organizations_list to find names.
Inputs
organization_namestringrequired- The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
terraform_organization_runs_listList runs across all workspaces in an HCP Terraform organization, with workspace, status and text filters.Read-onlyList Organization Runs
List runs across all workspaces in an HCP Terraform organization, with workspace, status and text filters. Returns run records with id, status, message and created-at; by default only runs from the last year. Use terraform_organization_runs_list to find active or failed runs anywhere. Use terraform_runs_list for one workspace.
Inputs
organization_namestringrequired- The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
filter_operationstring- Comma-separated run operations: plan_only, plan_and_apply, save_plan, refresh_only, destroy, empty_apply, action_only. plan_only runs are left out unless listed. Example: plan_and_apply,destroy
filter_sourcestring- Comma-separated run sources: tfe-ui, tfe-api, tfe-configuration-version. Example: tfe-api
filter_statusstring- Comma-separated run statuses to return, such as planned,errored,applied,policy_checked,discarded. Example: planned,errored
filter_status_groupstring- One status group: non_final (running or waiting), final (finished) or discardable. Example: non_finalone of
non_finalfinaldiscardable filter_timeframestring- A year such as 2025, or year for the past year. Example: 2025
filter_workspace_namesstring- Comma-separated workspace names to include. Example: networking-prod,app-prod
page_numberinteger- Page number to return, starting at 1. Defaults to the first page. Example: 2
page_sizeinteger- Number of results per page, 1 to 100. Defaults to 20. Example: 50
search_basicstring- Matches VCS username, commit SHA, run ID or run message; ignored if search_user or search_commit is set. Example: fix subnet
search_commitstring- Commit SHA the run used. Example: 7d0e1b5
search_userstring- VCS username that triggered the run. Example: octocat
terraform_organizations_listList the HCP Terraform organizations the token can access, optionally searching by name or notification email.Read-onlyList Organizations
List the HCP Terraform organizations the token can access, optionally searching by name or notification email. Returns organization records with id (the organization name), email, plan and permissions, plus pagination meta. Use terraform_organizations_list to find organization names. Use terraform_organization_get for one organization's settings.
Inputs
page_numberinteger- Page number to return, starting at 1. Defaults to the first page. Example: 2
page_sizeinteger- Number of results per page, 1 to 100. Defaults to 20. Example: 50
qstring- Search string that matches organization names and notification emails. Takes precedence over q_email and q_name. Example: acme
q_emailstring- Search string matched against the organization notification email only. Example: ops@acme.com
q_namestring- Search string matched against the organization name only. Example: acme-prod
terraform_plan_getGet one HCP Terraform plan by ID.Read-onlyGet Plan
Get one HCP Terraform plan by ID. Returns its status, resource additions, changes, destructions and imports, and log-read-url, a short-lived URL to download the plan log. Use terraform_plan_get with the plan ID from terraform_run_get relationships.plan.
Inputs
plan_idstringrequired- ID of the plan, starting with plan-. Find it in a run's relationships.plan.data.id. Example: plan-8F5JFydVYAmtTjET
terraform_project_getGet one HCP Terraform project by ID.Read-onlyGet Project
Get one HCP Terraform project by ID. Returns the project name, description, default execution mode, auto-destroy setting and its organization. Use terraform_project_get for a known ID. Use terraform_projects_list to search by name.
Inputs
project_idstringrequired- ID of the project, starting with prj-. Example: prj-WsVcWRr7SSxRDEDx
terraform_projects_listList the projects in an HCP Terraform organization, optionally searching by name.Read-onlyList Projects
List the projects in an HCP Terraform organization, optionally searching by name. Returns project records with id (prj-...), name, description, default execution mode and workspace count. Use terraform_projects_list to find project IDs. Use terraform_project_get for one project.
Inputs
organization_namestringrequired- The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
filter_namesstring- Exact project name, or several comma-separated names, to return (case-insensitive). Example: Default Project,networking
page_numberinteger- Page number to return, starting at 1. Defaults to the first page. Example: 2
page_sizeinteger- Number of results per page, 1 to 100. Defaults to 20. Example: 50
qstring- Case-insensitive search on project name. Ignored when filter_names is set. Example: networking
sortstring- Sort order: name, or -name for reverse alphabetical. Example: -nameone of
name-name
terraform_run_getGet one HCP Terraform run by ID.Read-onlyGet Run
Get one HCP Terraform run by ID. Returns its status, status timestamps, message, flags (is-destroy, refresh-only, plan-only), actions it allows and relationships to its plan, apply and workspace. Use terraform_run_get to check progress after terraform_run_create. Use terraform_plan_get for the plan's resource counts and log URL.
Inputs
run_idstringrequired- ID of the run to get, starting with run-. Use terraform_runs_list to find it. Example: run-CZcmD7eagjhyX0vN
terraform_runs_listList runs in one HCP Terraform workspace, newest first, with status, operation and text filters.Read-onlyList Workspace Runs
List runs in one HCP Terraform workspace, newest first, with status, operation and text filters. Returns run records with id (run-...), status, message, is-destroy, created-at and status timestamps. Rate limited to 30 requests per minute. Use terraform_runs_list for one workspace. Use terraform_organization_runs_list across workspaces. Use terraform_run_get for one run.
Inputs
workspace_idstringrequired- ID of the workspace, starting with ws-. Use terraform_workspaces_list or terraform_workspace_get_by_name to find it. Example: ws-SihZTyXKfNXUWuUa
filter_operationstring- Comma-separated run operations: plan_only, plan_and_apply, save_plan, refresh_only, destroy, empty_apply, action_only. plan_only runs are left out unless listed. Example: plan_and_apply,destroy
filter_sourcestring- Comma-separated run sources: tfe-ui, tfe-api, tfe-configuration-version. Example: tfe-api
filter_statusstring- Comma-separated run statuses to return, such as planned,errored,applied,policy_checked,discarded. Example: planned,errored
filter_status_groupstring- One status group: non_final (running or waiting), final (finished) or discardable. Example: non_finalone of
non_finalfinaldiscardable filter_timeframestring- A year such as 2025, or year for the past year. Example: 2025
page_numberinteger- Page number to return, starting at 1. Defaults to the first page. Example: 2
page_sizeinteger- Number of results per page, 1 to 100. Defaults to 20. Example: 50
search_basicstring- Matches VCS username, commit SHA, run ID or run message; ignored if search_user or search_commit is set. Example: fix subnet
search_commitstring- Commit SHA the run used. Example: 7d0e1b5
search_userstring- VCS username that triggered the run. Example: octocat
terraform_state_versions_listList the state versions of one HCP Terraform workspace, newest first, identified by organization and workspace name.Read-onlyList State Versions
List the state versions of one HCP Terraform workspace, newest first, identified by organization and workspace name. Returns state versions with id (sv-...), serial, status, created-at, resource and provider details and download URLs. Use terraform_state_versions_list for state history. Use terraform_workspace_current_state_version_get for the latest only.
Inputs
organization_namestringrequired- Name of the organization that owns the workspace. Example: my-org
workspace_namestringrequired- Name of the workspace whose state versions to list. Example: networking-prod
page_numberinteger- Page number to return, starting at 1. Defaults to the first page. Example: 2
page_sizeinteger- Number of results per page, 1 to 100. Defaults to 20. Example: 50
statusstring- Only state versions with this status: pending, finalized or discarded. Example: finalizedone of
pendingfinalizeddiscarded
terraform_teams_listList the teams in an HCP Terraform organization, optionally searching by name.Read-onlyList Teams
List the teams in an HCP Terraform organization, optionally searching by name. Returns teams with id (team-...), name, visibility, user count and organization access settings. Use terraform_teams_list to find team IDs and members' access.
Inputs
organization_namestringrequired- The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
filter_namesstring- Exact team name, or several comma-separated names, to return. Example: owners,platform
page_numberinteger- Page number to return, starting at 1. Defaults to the first page. Example: 2
page_sizeinteger- Number of results per page, 1 to 100. Defaults to 20. Example: 50
qstring- Case-insensitive search on team name. Example: platform
terraform_variable_sets_listList the variable sets in an HCP Terraform organization, optionally searching by name.Read-onlyList Variable Sets
List the variable sets in an HCP Terraform organization, optionally searching by name. Returns variable sets with id (varset-...), name, description, global and priority flags, and the workspaces, projects and variables they apply to. Use terraform_variable_sets_list for shared variables. Use terraform_workspace_variables_list for variables set on one workspace.
Inputs
organization_namestringrequired- The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
page_numberinteger- Page number to return, starting at 1. Defaults to the first page. Example: 2
page_sizeinteger- Number of results per page, 1 to 100. Defaults to 20. Example: 50
qstring- Search variable sets by name. Example: aws-credentials
terraform_workspace_current_state_outputs_listList the output values from the current state of an HCP Terraform workspace.Read-onlyList Current State Outputs
List the output values from the current state of an HCP Terraform workspace. Returns outputs with name, type, value and sensitive flag; sensitive values come back as null. Returns 503 while outputs are still being processed, so retry later. Use terraform_workspace_current_state_outputs_list to read outputs such as endpoints or IDs. It only needs read-outputs permission.
Inputs
workspace_idstringrequired- ID of the workspace, starting with ws-. Use terraform_workspaces_list or terraform_workspace_get_by_name to find it. Example: ws-SihZTyXKfNXUWuUa
terraform_workspace_current_state_version_getGet the current state version of an HCP Terraform workspace.Read-onlyGet Current State Version
Get the current state version of an HCP Terraform workspace. Returns its id (sv-...), serial, Terraform version, resource list with counts, and short-lived hosted-state-download-url and hosted-json-state-download-url links. Needs permission to read state versions. Use terraform_workspace_current_state_version_get for the latest state. Use terraform_workspace_current_state_outputs_list for output values only.
Inputs
workspace_idstringrequired- ID of the workspace, starting with ws-. Use terraform_workspaces_list or terraform_workspace_get_by_name to find it. Example: ws-SihZTyXKfNXUWuUa
terraform_workspace_getGet one HCP Terraform workspace by ID.Read-onlyGet Workspace
Get one HCP Terraform workspace by ID. Returns its settings (execution mode, Terraform version, auto-apply, working directory, VCS repo), lock state, resource count and relationships such as current run and project. Use terraform_workspace_get when you have the ws- ID. Use terraform_workspace_get_by_name when you have the organization and workspace name.
Inputs
workspace_idstringrequired- ID of the workspace, starting with ws-. Use terraform_workspaces_list or terraform_workspace_get_by_name to find it. Example: ws-SihZTyXKfNXUWuUa
terraform_workspace_get_by_nameGet one HCP Terraform workspace by organization and workspace name.Read-onlyGet Workspace by Name
Get one HCP Terraform workspace by organization and workspace name. Returns the same workspace record as terraform_workspace_get, including its ws- ID. Use terraform_workspace_get_by_name to turn a workspace name into its ID. Use terraform_workspace_get when you already have the ID.
Inputs
organization_namestringrequired- The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
workspace_namestringrequired- Exact workspace name (letters, numbers, - and _). Example: networking-prod
terraform_workspace_variables_listList the Terraform and environment variables set directly on an HCP Terraform workspace.Read-onlyList Workspace Variables
List the Terraform and environment variables set directly on an HCP Terraform workspace. Returns variables with id (var-...), key, value (null when sensitive), category, hcl and sensitive flags. Use terraform_workspace_variables_list before updating or deleting a variable. Use terraform_variable_sets_list for shared variable sets.
Inputs
workspace_idstringrequired- ID of the workspace, starting with ws-. Use terraform_workspaces_list or terraform_workspace_get_by_name to find it. Example: ws-SihZTyXKfNXUWuUa
terraform_workspaces_listList the workspaces in an HCP Terraform organization, with name search, tag filters, project filter and sorting.Read-onlyList Workspaces
List the workspaces in an HCP Terraform organization, with name search, tag filters, project filter and sorting. Returns workspace records with id (ws-...), name, execution mode, Terraform version, locked state, resource count and latest run, plus pagination meta. Use terraform_workspaces_list to search or browse. Use terraform_workspace_get or terraform_workspace_get_by_name for one workspace.
Inputs
organization_namestringrequired- The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
current_run_statusstring- Return only workspaces whose current run has this status, such as planned, applied, errored or policy_checked. Example: errored
page_numberinteger- Page number to return, starting at 1. Defaults to the first page. Example: 2
page_sizeinteger- Number of results per page, 1 to 100. Defaults to 20. Example: 50
project_idstring- Return only workspaces in this project (prj-...). Example: prj-WsVcWRr7SSxRDEDx
search_exclude_tagsstring- Leave out workspaces that have any of these flat string tags, comma-separated. Example: deprecated
search_namestring- Fuzzy search on workspace name. Example: networking
search_tagsstring- Return only workspaces that have all of these flat string tags, comma-separated. Example: networking,prod
search_wildcard_namestring- Workspace name pattern with * at the start, end or both. Example: *-prod
sortstring- Sort by name, current-run.created-at or latest-change-at; prefix with - to reverse. Example: -current-run.created-atone of
name-namecurrent-run.created-at-current-run.created-atlatest-change-at-latest-change-at
terraform_project_createCreate a project in an HCP Terraform organization to group workspaces.WriteCreate Project
Create a project in an HCP Terraform organization to group workspaces. Returns the new project with its id (prj-...). Use terraform_project_create for a new project. Use terraform_workspace_create with project_id to add workspaces to it.
Inputs
namestringrequired- Project name: 3 to 40 characters of letters, numbers, spaces, - and _, not starting or ending with a space. Example: networking
organization_namestringrequired- The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
default_execution_modestring- Default execution mode for workspaces in this project: remote, local or agent. Defaults to remote. agent also needs a default agent pool, which this tool does not set. Example: remoteone of
remotelocalagent descriptionstring- Project description, up to 256 characters. Example: Shared network infrastructure
terraform_run_applyConfirm and apply a run that is waiting for confirmation after its plan (status planned, cost_estimated or policy_checked).WriteApply Run
Confirm and apply a run that is waiting for confirmation after its plan (status planned, cost_estimated or policy_checked). Returns 202 with no body; the apply is queued. Fails with 409 if the run is not waiting for confirmation. Use terraform_run_apply to approve a plan. Use terraform_run_discard to reject it. Needs a user or team token.
Inputs
run_idstringrequired- ID of the run to apply, starting with run-. Use terraform_runs_list to find it. Example: run-CZcmD7eagjhyX0vN
commentstring- Optional comment recorded with the apply. Example: Approved after review
terraform_run_cancelInterrupt a run that is currently planning or applying, like pressing Ctrl+C.WriteCancel Run
Interrupt a run that is currently planning or applying, like pressing Ctrl+C. Returns 202 with no body. Fails with 409 if the run is not planning or applying. Use terraform_run_cancel for an in-progress run. Use terraform_run_discard for a run waiting for confirmation.
Inputs
run_idstringrequired- ID of the run to cancel, starting with run-. Use terraform_runs_list to find it. Example: run-CZcmD7eagjhyX0vN
commentstring- Optional comment recorded with the cancel. Example: Approved after review
terraform_run_createQueue a new run (plan, and apply if confirmed or auto-applied) in an HCP Terraform workspace using its latest or a given configuration version.WriteCreate Run
Queue a new run (plan, and apply if confirmed or auto-applied) in an HCP Terraform workspace using its latest or a given configuration version. Returns the new run with id (run-...) and status pending. Use terraform_run_create to plan or destroy. Use terraform_run_apply to confirm a run waiting for approval. Needs a user or team token, not an organization token.
Inputs
workspace_idstringrequired- ID of the workspace to run in, starting with ws-. Example: ws-SihZTyXKfNXUWuUa
allow_empty_applyboolean- Allow applying even when the plan has no changes, for example to upgrade state after a Terraform version change. Example: false
auto_applyboolean- Apply automatically when the plan succeeds. Defaults to the workspace's auto-apply setting. Example: false
configuration_version_idstring- Configuration version to run (cv-...). Defaults to the workspace's latest. Example: cv-n4XQPBa2QnecZJ4G
is_destroyboolean- true to plan destroying all managed resources. Cannot be combined with refresh_only. Example: false
messagestring- Message shown on the run. Defaults to "Queued manually via the Terraform Enterprise API". Example: Scale web tier to 3 replicas
plan_onlyboolean- true for a speculative plan that cannot be applied. Example: true
refresh_onlyboolean- true to only refresh state without changing resources. Cannot be combined with is_destroy. Example: false
replace_addrsarray- Resource addresses passed to -replace. Example: ["aws_instance.web"]
target_addrsarray- Resource addresses passed to -target. Example: ["aws_instance.web"]
terraform_versionstring- Terraform version for this run; only valid for plan-only runs. Example: 1.10.0
variablesarray- Run-specific variable values; each item has key and value, where value is an HCL literal (strings need inner quotes). Example: [{"key": "replicas", "value": "3"}, {"key": "env", "value": "\"prod\""}]
terraform_run_discardDiscard a run that is waiting for confirmation or a policy override, so it is not applied.WriteDiscard Run
Discard a run that is waiting for confirmation or a policy override, so it is not applied. Returns 202 with no body. Fails with 409 if the run cannot be discarded. Use terraform_run_discard to reject a plan. Use terraform_run_cancel to stop a run that is planning or applying.
Inputs
run_idstringrequired- ID of the run to discard, starting with run-. Use terraform_runs_list to find it. Example: run-CZcmD7eagjhyX0vN
commentstring- Optional comment recorded with the discard. Example: Approved after review
terraform_workspace_createCreate a workspace in an HCP Terraform organization, optionally in a project and connected to a VCS repository.WriteCreate Workspace
Create a workspace in an HCP Terraform organization, optionally in a project and connected to a VCS repository. Returns the new workspace with its id (ws-...). Use terraform_workspace_create for a new workspace. Use terraform_workspace_update to change one that exists.
Inputs
namestringrequired- Workspace name, unique in the organization; letters, numbers, - and _ only. Example: networking-prod
organization_namestringrequired- The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
agent_pool_idstring- Agent pool ID (apool-...); required when execution_mode is agent and not allowed otherwise. Example: apool-yoGUFz5zcRMMz53i
allow_destroy_planboolean- Whether destroy plans can be queued on the workspace. Defaults to true on create. Example: true
auto_applyboolean- Whether successful plans from VCS, UI or CLI runs apply automatically. Example: false
descriptionstring- Workspace description. Example: Production VPC and subnets
execution_modestring- Where runs execute: remote (HCP Terraform), local (state storage only) or agent (needs agent_pool_id). Example: remoteone of
remotelocalagent project_idstring- Project to create the workspace in (prj-...). Defaults to the organization's default project. Example: prj-WsVcWRr7SSxRDEDx
terraform_versionstring- Terraform version or version constraint for the workspace, such as 1.9.5 or ~> 1.9.0. Defaults to the latest release on create. Example: 1.9.5
vcs_repoobject- VCS repository settings. Needs identifier (org/repo) and either oauth-token-id (ot-...) or github-app-installation-id (ghain-...); optional branch, ingress-submodules and tags-regex. Keys use hyphens. Example: {"identifier": "acme/infra", "oauth-token-id": "ot-hmAyP66qk2AMVdbJ", "branch": "main"}
working_directorystring- Relative path in the repository where Terraform runs. Example: environments/prod
terraform_workspace_lockLock an HCP Terraform workspace so no new runs can start until it is unlocked.WriteLock Workspace
Lock an HCP Terraform workspace so no new runs can start until it is unlocked. Returns the workspace with locked true. Fails with 409 if it is already locked. Use terraform_workspace_lock before maintenance. Use terraform_workspace_unlock to release it.
Inputs
workspace_idstringrequired- ID of the workspace to lock, starting with ws-. Example: ws-SihZTyXKfNXUWuUa
reasonstring- Why the workspace is locked, shown to other users. Example: Maintenance window
terraform_workspace_unlockUnlock an HCP Terraform workspace that the same user or team locked.WriteUnlock Workspace
Unlock an HCP Terraform workspace that the same user or team locked. Returns the workspace with locked false. Fails with 409 if it is not locked or was locked by someone else. Use terraform_workspace_unlock after terraform_workspace_lock.
Inputs
workspace_idstringrequired- ID of the workspace to unlock, starting with ws-. Example: ws-SihZTyXKfNXUWuUa
terraform_workspace_updateUpdate settings of an HCP Terraform workspace by ID; only the fields you pass change.WriteUpdate Workspace
Update settings of an HCP Terraform workspace by ID; only the fields you pass change. Returns the updated workspace. Use terraform_workspace_update to rename or reconfigure a workspace. Use terraform_workspace_lock to block runs instead.
- Idempotent
Inputs
workspace_idstringrequired- ID of the workspace to update, starting with ws-. Example: ws-SihZTyXKfNXUWuUa
agent_pool_idstring- Agent pool ID (apool-...); required when execution_mode is agent and not allowed otherwise. Example: apool-yoGUFz5zcRMMz53i
allow_destroy_planboolean- Whether destroy plans can be queued on the workspace. Defaults to true on create. Example: true
auto_applyboolean- Whether successful plans from VCS, UI or CLI runs apply automatically. Example: false
descriptionstring- Workspace description. Example: Production VPC and subnets
execution_modestring- Where runs execute: remote (HCP Terraform), local (state storage only) or agent (needs agent_pool_id). Example: remoteone of
remotelocalagent namestring- New workspace name; letters, numbers, - and _ only. Renaming changes the workspace's URL. Example: networking-production
terraform_versionstring- Terraform version or version constraint for the workspace, such as 1.9.5 or ~> 1.9.0. Defaults to the latest release on create. Example: 1.9.5
vcs_repoobject- VCS repository settings. Needs identifier (org/repo) and either oauth-token-id (ot-...) or github-app-installation-id (ghain-...); optional branch, ingress-submodules and tags-regex. Keys use hyphens. Example: {"identifier": "acme/infra", "oauth-token-id": "ot-hmAyP66qk2AMVdbJ", "branch": "main"}
working_directorystring- Relative path in the repository where Terraform runs. Example: environments/prod
terraform_workspace_variable_createCreate a Terraform or environment variable on an HCP Terraform workspace.WriteCreate Workspace Variable
Create a Terraform or environment variable on an HCP Terraform workspace. Returns the new variable with its id (var-...). Use terraform_workspace_variable_create for a new key. Use terraform_workspace_variable_update to change an existing one.
Inputs
categorystringrequired- terraform for a Terraform input variable, env for an environment variable. Example: terraformone of
terraformenv keystringrequired- Variable name. Example: region
workspace_idstringrequired- ID of the workspace, starting with ws-. Use terraform_workspaces_list or terraform_workspace_get_by_name to find it. Example: ws-SihZTyXKfNXUWuUa
descriptionstring- Variable description. Example: AWS region
hclboolean- true to evaluate the value as HCL (lists, maps); no effect on environment variables. Example: false
sensitiveboolean- true to make the value write-only; it is never shown again. Example: false
valuestring- Variable value. HCL values are evaluated as HCL when hcl is true. Example: us-east-1
terraform_workspace_variable_updateUpdate a variable on an HCP Terraform workspace; only the fields you pass change.WriteUpdate Workspace Variable
Update a variable on an HCP Terraform workspace; only the fields you pass change. Returns the updated variable. Use terraform_workspace_variable_update to change a value. Get the variable ID from terraform_workspace_variables_list.
- Idempotent
Inputs
variable_idstringrequired- ID of the variable, starting with var-. Example: var-EavQ1LztoRTQHSNT
workspace_idstringrequired- ID of the workspace that owns the variable, starting with ws-. Example: ws-SihZTyXKfNXUWuUa
categorystring- terraform or env. Example: terraformone of
terraformenv descriptionstring- Variable description. Example: AWS region
hclboolean- true to evaluate the value as HCL (lists, maps); no effect on environment variables. Example: false
keystring- New variable name. Example: aws_region
sensitiveboolean- true to make the value write-only; it is never shown again. Example: false
valuestring- Variable value. HCL values are evaluated as HCL when hcl is true. Example: us-east-1
terraform_workspace_safe_deleteDelete an HCP Terraform workspace only if it manages no resources.DestructiveSafe Delete Workspace
Delete an HCP Terraform workspace only if it manages no resources. Returns no content on success; returns 409 if the workspace still manages resources (destroy them first with terraform_run_create and is_destroy). Use terraform_workspace_safe_delete to remove an empty workspace. It cannot be undone.
- Idempotent
Inputs
workspace_idstringrequired- ID of the workspace to delete, starting with ws-. Example: ws-SihZTyXKfNXUWuUa
terraform_workspace_variable_deleteDelete a variable from an HCP Terraform workspace.DestructiveDelete Workspace Variable
Delete a variable from an HCP Terraform workspace. Returns no content on success. Use terraform_workspace_variable_delete to remove a key. Get the variable ID from terraform_workspace_variables_list.
- Idempotent
Inputs
variable_idstringrequired- ID of the variable to delete, starting with var-. Example: var-EavQ1LztoRTQHSNT
workspace_idstringrequired- ID of the workspace that owns the variable, starting with ws-. Example: ws-SihZTyXKfNXUWuUa
No tools match.