Capability library / Application package

Terraform package v1.0.0

HCP Terraform and Terraform Enterprise: read workspaces and runs; create workspaces with automation; queue, apply or discard runs that may deploy or destroy resources; and force-delete workspaces.

Review state: Reviewed · Distributable: yes, digest matches the release manifest

This page describes AAES Govern’s controls. AAES Operate has private-work permissions, operational reviews and recorded-spend limits; it does not include Govern. About AAES Govern

Before you enable this package

The endpoint host 'terraform-cloud.invalid' is a reserved .invalid placeholder that fails closed until you substitute the real host in both the endpoint URLs and the egress allowlist.

Read each action's effects and exclusions below. Before installation, also read the complete package requirements, including credential issuance, scope, expiry, and provider permissions. These are deployment prerequisites, not capabilities this package supplies.

Capabilities (7)

Each capability below is one registered operation. The complete package JSON includes its exact network destination allowlist. The repository stores it at packs/terraform.json and embeds a copy in the release binary.

Risk tiers. R0 is the minimum for reads. R2 is the minimum for write, create, update, execute, and invoke. R3 is the minimum for delete, send, pay, deploy, approve, share, and transfer. Operators can raise these levels. A minimum tier does not measure the operation's business or confidentiality risk.

On supported execution paths routed through AAES Govern, the R3 actions listed below require approval by an authorized person. Bypass paths and observation-only registrations are outside that guarantee. A provider's restoration feature does not remove this approval requirement. A provider-side approval, such as approving a GitLab merge request, is also separate from AAES Govern human approval. The capability matrix shows which execution paths are implemented, restricted to lab use, or refused at startup. Live compatibility must be tested in your environment.

Field guide. Endpoint is the service address and request method. Connector is the adapter that makes the call. Custody describes how the credential is held; the credential reference identifies the value to resolve. Data class sets handling requirements: pii means personal data, financial means financial records, and internal means internal organizational data.

terraform.workspaces.read v1.0.0R0

Kind
tool
Action
read
Endpoint
GET https://terraform-cloud.invalid/api/v2/organizations/ORG/workspaces
Connector
http
Custody
customer_vault
Credential ref
secret-ref-terraform-api-token
Data class
internal

Read workspaces.

List the workspaces in one HCP Terraform organization: names, execution modes, VCS repo identifiers, terraform versions, resource counts and lock state, which reveal internal infrastructure topology. According to the reviewed Workspaces reference the collection endpoint supports tag filtering and pagination; the registered path covers the collection read only — single-workspace reads (by id or by name) and remote-state-consumer listings are not registered by this pack. ORG is a placeholder the deployment binds before enabling; the host is a reserved placeholder: substitute the customer's HCP Terraform or Enterprise host before enabling.

terraform.runs.read v1.0.0R0

Kind
tool
Action
read
Endpoint
GET https://terraform-cloud.invalid/api/v2/workspaces/WORKSPACE_ID/runs
Connector
http
Custody
customer_vault
Credential ref
secret-ref-terraform-api-token
Data class
internal

Read runs.

List the runs in one workspace: statuses, messages, sources and creator references, which reveal change history. According to the reviewed Runs reference the endpoint supports operation, status, source and timeframe filters and search parameters, has an adjusted rate limit of 30 requests per minute, and by default excludes plan_only runs unless filtered in. The registered path covers the collection read only — single-run details (GET /runs/{run_id}), plan/apply JSON output and cost estimates are not registered. WORKSPACE_ID is a placeholder the deployment binds before enabling.

terraform.workspace.create v1.0.0R3

Kind
tool
Actions
create, deploy
Endpoint
POST https://terraform-cloud.invalid/api/v2/organizations/ORG/workspaces
Connector
http
Custody
customer_vault
Credential ref
secret-ref-terraform-api-token
Data class
internal

Create workspace.

Create a workspace with caller-supplied JSON:API attributes, including VCS repository linkage, execution mode, Terraform version, and auto-apply defaults.

The unrestricted body can enable VCS run triggers (file triggers or queue-all-runs) and auto-apply. Later VCS pushes can then plan and apply infrastructure changes inside Terraform without going through terraform.run.create, terraform.run.apply, or another AAES capability. The capability therefore declares create and deploy at R3. Enforce any restriction to inactive workspaces separately.

Creation requires team owner, Manage-all-workspaces permission, or an organization token. Bind ORG before enabling.

terraform.run.create v1.0.0R3

Kind
tool
Actions
create, deploy, delete
Endpoint
POST https://terraform-cloud.invalid/api/v2/runs
Connector
http
Custody
customer_vault
Credential ref
secret-ref-terraform-api-token
Data class
internal

Create run.

Queue a run that plans and applies infrastructure using a configuration version and workspace variables. The unrestricted body can set auto-apply (no later confirmation), is-destroy=true (destroy all resources managed by the workspace), refresh-only, save-plan, and target or replace addresses.

Because the request can deploy changes or destroy the workspace's managed resources, it declares create, deploy, and delete at R3. Enforce any restriction to speculative plan-only runs separately.

The caller needs queue-plan permission; organization tokens cannot create runs. The body selects the target, including WORKSPACE_ID in relationships. Review every workspace accessible to the token; the registration does not narrow that selection.

terraform.run.apply v1.0.0R3

Kind
tool
Actions
approve, deploy, delete
Endpoint
POST https://terraform-cloud.invalid/api/v2/runs/RUN_ID/actions/apply
Connector
http
Custody
customer_vault
Credential ref
secret-ref-terraform-api-token
Data class
internal

Apply run.

Confirm a planned run and queue its apply. The run must be paused for confirmation, including needs-confirmation or policy-checked states. Applying changes real infrastructure and may destroy managed resources. Registered as approve, deploy, and delete at R3.

The endpoint returns 202 when queued, rather than when apply completes; apply is asynchronous. It returns 409 if the run is not paused for confirmation. Organization tokens cannot call this operation. Bind RUN_ID before enabling.

On supported execution paths mediated by AAES Govern, these actions require approval by an authorized person; this does not prevent calls through bypass or observation-only paths. Terraform's provider-side confirmation is separate from AAES approval.

terraform.run.discard v1.0.0R3

Kind
tool
Action
delete
Endpoint
POST https://terraform-cloud.invalid/api/v2/runs/RUN_ID/actions/discard
Connector
http
Custody
customer_vault
Credential ref
secret-ref-terraform-api-token
Data class
internal

Discard run.

Discard a run paused for confirmation or priority. It skips remaining work, reaches the final discarded state, and lets later runs proceed. Replacing it requires a new run; the discarded plan cannot be restored.

Registered as delete at R3. The caller needs apply-runs permission; organization tokens cannot call it. Bind RUN_ID before enabling.

Cancel and force-cancel are excluded. Terraform warns that force-cancel can lose in-flight state.

terraform.workspace.delete v1.0.0R3

Kind
tool
Action
delete
Endpoint
DELETE https://terraform-cloud.invalid/api/v2/workspaces/WORKSPACE_ID
Connector
http
Custody
customer_vault
Credential ref
secret-ref-terraform-api-token
Data class
internal

Delete workspace.

Force-delete a workspace without checking whether it manages resources. The workspace, state history, and run history are removed; its real infrastructure keeps running without the workspace that managed it.

Registered as delete at R3. The safe-delete operation (POST /workspaces/{id}/actions/safe-delete), which refuses while resources are managed, is excluded. This package supplies only force deletion. Bind WORKSPACE_ID before enabling.

Credential reference

The credential field names a reference rather than containing credential material. Packs are designed not to contain secrets; the format checks cover only known credential formats and cannot prove that arbitrary text contains no secrets. Installing a package registers its capabilities. Configure the provider credentials, endpoints, and network access, then test the integration in your environment before enabling it.

Reference
secret-ref-terraform-api-token
Custody
customer_vault
Injection
header (Authorization)

Configure the value and injection format specified in the package. Assign responsibility for credential rotation and revocation, restrict provider permissions, and keep credential material out of logs and responses.

Complete credential requirements

An HCP Terraform API token for the customer's own organization, held in the client's own secret manager. The stored material must be the complete Authorization header value: the scheme 'Bearer', one separating space, then the token — 'Bearer <token>'.

Issuance is external and three token types exist according to the reviewed API overview: user tokens (each user can have any number, created on the user's account settings page), team tokens (created in the team's settings and intended for plans and applies via CI/CD; according to the reviewed token-management documentation the CURRENT team token API allows multiple valid tokens per team when their descriptions are unique — only legacy tokens are one-at-a-time) and organization tokens (one per organization, intended for automating team and workspace management — and per the same reference, organization tokens CANNOT perform plans and applies).

This pack's run capabilities require a user or team token; prefer a team token on a dedicated least-privilege team so the credential is not a person's identity.

Least privilege: place that team on only the workspaces the deployment binds, with Read permission for the collection reads, and Apply runs / Admin permissions only where the run and workspace-write capabilities are enabled.

Expiry and revocation: per HashiCorp's token-management documentation (retrieved during the documented review and appended to the review sources), each user, team and organization token HAS an expiration date and time chosen at creation — it cannot be modified afterward, any API request made with an expired token fails, HCP Terraform sends notification emails 30 days and 7 days before expiry, and organization owners can set a maximum token time-to-live in the organization's settings; the custody job must therefore record the expiry stamped at issuance and rotate before it rather than treating the token as valid until revoked.

Revocation is explicit: delete the individual user, team or organization token in settings (team tokens can be deleted individually or in bulk, and only organization owners can generate or revoke the organization token); a deleted value fails closed with a 401. Token multiplicity differs by type and matters for rotation: an organization can have only ONE valid organization token at a time, but the CURRENT team token API supports MULTIPLE valid team tokens at a time (descriptions unique within the team) and adding a new team token does NOT invalidate older ones — only the legacy team-token API is one-at-a-time, where generating a new legacy token invalidates the previous one; so minting a successor does not retire the old team token, and every issued token must be deleted individually at end of life. HCP Terraform displays an API token only once at creation and obfuscates it thereafter, so a lost value must be regenerated, not retrieved.

Rotation therefore sits with an external deployment process: the executor injects the stored value verbatim and performs no token lifecycle of its own. A fourth token type, the audit trails token, reads only the organization's audit trails and cannot serve any capability in this pack.

Executor hygiene: the value must live only in executor memory for the lifetime of a call, must never be written to logs, traces or diagnostics, and must not appear in crash dumps; a deployment that cannot meet that bar must not enable the pack.

Resources

  • terraform-organization (api, internal): https://terraform-cloud.invalid/api/v2/organizations/ORG

Technical package and review record

Complete provider requirements and exclusions

The endpoint host 'terraform-cloud.invalid' is a reserved non-production placeholder (an RFC 2606 reserved TLD): substitute the customer's HCP Terraform host (app.terraform.io) or Terraform Enterprise hostname before enabling, in every endpoint, in the resource locator and in every egress allowlist entry. The allowlist matches exactly, so endpoints and allowlist must be substituted together, and substitution is a required deployment step. ORG, WORKSPACE_ID and RUN_ID in the endpoint paths are placeholders the deployment binds before enabling.

Per the retrieved API overview the API is version 2 under the /api/v2 prefix and speaks JSON:API (Content-Type application/vnd.api+json), POST and PATCH endpoints take a JSON:API document as the request payload, and list endpoints paginate with page[number]/page[size] query parameters. Token types: according to the reviewed overview, ORGANIZATION tokens cannot perform plans and applies, so the run create/apply/discard capabilities require a user or team token, and forbidden requests with a valid token return 404 rather than 403 — a capability that inexplicably 404s is a permissions finding, not an absence of the resource.

Approval classification: run creation registers as create, deploy AND delete at the minimum R3 tier, judged by effect — according to the reviewed Runs reference a run performs a plan and apply, and the caller-controlled body can set auto-apply (apply without a further confirmation step), is-destroy=true (the plan destroys ALL provisioned resources in the workspace) and target/replace addresses — so an unrestricted body can both deploy infrastructure change and destroy the whole estate a workspace manages; deploy and delete are designated actions requiring human approval and an installer's intention to queue only plan-only runs is not a restriction.

Applying a run registers as approve, deploy AND delete at the minimum R3 tier: the apply action confirms a run paused for confirmation and queues the apply of the reviewed plan — it is precisely the approval moment — and the plan being applied may itself destroy managed resources, so delete is declared as well. Discarding a run registers as delete at the minimum R3 tier: discard is terminal (the run reaches its discarded final state and later runs can proceed), and queuing a fresh run afterward is a new run, not a reversal of the discard.

Workspace creation registers as create AND deploy at the minimum R3 tier: according to the reviewed Workspaces reference the unrestricted body can link a VCS repository with automatic run triggering, speculative plans and auto-apply, and those VCS-triggered executions run provider-side — they need not traverse terraform.run.create or terraform.run.apply or any other AAES capability. Workspace deletion registers as delete at the minimum R3 tier: according to the reviewed Workspaces reference, DELETE /workspaces/{id} FORCE-deletes the workspace WITHOUT first checking for managed resources — destroying nothing itself but orphaning real infrastructure whose management record is gone; the checking form (POST .../actions/safe-delete, which refuses while resources are managed) is deliberately not registered, so this pack's only workspace deletion is the force form and the description says so.

Documented exclusions — this pack does not register: state versions and state version outputs (state routinely contains cleartext secrets, and hosted-state download URLs are themselves bearer-secret URLs according to the reviewed overview), variable creation/update (writing variables injects configuration, including sensitive values, into future runs), configuration-version upload, run force-execute and force-cancel (according to the reviewed Runs reference, force-cancel warns of potentially dangerous side effects including loss of in-flight state), policy check overrides, workspace lock/unlock/force-unlock, team and organization membership management, agent pools and agent tokens, SSH keys, organization tokens and audit-trails tokens, and every other HCP Terraform API.

Download the complete package JSON for exact network allowlists, credential requirements, exclusions, and setup notes. Read these requirements before installation.

The full documentation review record is supplied in the evaluation package. The evaluation package runs in your environment and comes only with the paid design partnership. This page reproduces the source links and review block; the full record is available for evaluation. Discuss a design partnership to inspect it before installation.

Review block

This section reproduces the review block recorded in the pack file. The evidence and approval record is separate: for a reviewed pack, it is in the evaluation materials and in the release binary's embedded assets.

Review completed: 2026-09-22

4 sources, retrieved 2026-09-21

Current documentation links are navigation aids. They do not change the package, its historical sources or its review date. Review dates describe a documentation review, not a live integration test. No package is provider-endorsed or yet tested against a live provider tenant.

Release identity

SHA-256 of the pack file bytes: a1ee095a48b2a864fddc0e75e317fbf72dd93838e868b47743a19b63f4090a61

Distributable: yes, digest matches the release manifest. Editing a package changes its release identity. A deployment plan checks its own file digests; it does not restore reviewed status or authenticate approval.