Skip to content

Reference

Terraform

Connect Terraform to Alter Vault for secure API access

Use Terraform credentials to make authenticated API calls through Alter Vault without exposing API keys in code.

PropertyValue
Provider IDterraform
CategoryDeveloper Tools
Credential TypeBearer Token

Log in to HCP Terraform

Log in to HCP Terraform at app.terraform.io.

Go to User Settings → Tokens

Go to User Settings → Tokens at app.terraform.io/app/settings/tokens.

Create an API token

Click ‘Create an API token’.

Copy your token

Copy the generated token.

Open the Developer Portal

Go to portal.alterauth.com and navigate to the application.

Add Terraform

Go to Managed Secrets > Add Provider > Terraform.

Enter credentials

Paste your API Token into the credential field.

Save

Click Save. You’ll receive a grant_id to use with the SDK.

response = await alter_app.request(
HttpMethod.GET,
"https://app.terraform.io/api/v2/organizations",
grant_id="YOUR_GRANT_ID",
)

Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.

Operation IDFamiliesMethodProvider path
account/detailsreadGET/api/v2/account/details
applies/showreadGET/api/v2/applies/{apply_id}
organizations/listreadGET/api/v2/organizations
organizations/showreadGET/api/v2/organizations/{organization_name}
plans/showreadGET/api/v2/plans/{plan_id}
projects/createwritePOST/api/v2/organizations/{organization_name}/projects
projects/listreadGET/api/v2/organizations/{organization_name}/projects
runs/createwritePOST/api/v2/runs
runs/applywritePOST/api/v2/runs/{run_id}/actions/apply
runs/cancelwritePOST/api/v2/runs/{run_id}/actions/cancel
runs/discardwritePOST/api/v2/runs/{run_id}/actions/discard
runs/listreadGET/api/v2/workspaces/{workspace_id}/runs
runs/showreadGET/api/v2/runs/{run_id}
state-versions/currentreadGET/api/v2/workspaces/{workspace_id}/current-state-version
state-versions/showreadGET/api/v2/state-versions/{state_version_id}
vars/createwritePOST/api/v2/workspaces/{workspace_id}/vars
vars/deletedeleteDELETE/api/v2/workspaces/{workspace_id}/vars/{variable_id}
vars/listreadGET/api/v2/workspaces/{workspace_id}/vars
vars/updatewritePATCH/api/v2/workspaces/{workspace_id}/vars/{variable_id}
workspaces/createwritePOST/api/v2/organizations/{organization_name}/workspaces
workspaces/deletedeleteDELETE/api/v2/workspaces/{workspace_id}
workspaces/listreadGET/api/v2/organizations/{organization_name}/workspaces
workspaces/lockwritePOST/api/v2/workspaces/{workspace_id}/actions/lock
workspaces/safe-deletedeletePOST/api/v2/workspaces/{workspace_id}/actions/safe-delete
workspaces/showreadGET/api/v2/workspaces/{workspace_id}
workspaces/unlockwritePOST/api/v2/workspaces/{workspace_id}/actions/unlock
workspaces/updatewritePATCH/api/v2/workspaces/{workspace_id}

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.