Claude Terraform Provider

Create one Claude workspace per client, review agent changes before applying them, and see which resources AWS, Google Cloud and Bedrock support.

Published

Claude Terraform Provider

You can give each client a Claude Platform workspace from the same reviewed configuration. When a client needs an exception, the reviewer sees exactly which line changes before anyone touches the account. The Claude Terraform provider entered public beta on December 3, 2026. Start with the workspace if you use the Claude API. If you run on a cloud platform, check which resources it lets you change first. December 3 release notes

One file for a client's first workspace

Imagine an agency opening a workspace called research. Today a lead might set it up in the console, hand a colleague a checklist, then ask them to verify the live settings. With Terraform, the lead writes the intended settings in a file. A provider is the plug-in that reads those settings and talks to the service. A plan shows what Terraform proposes to change. Apply makes those changes. The colleague can now review the workspace name and the target organization while there's still time to correct either.

A provider drawer labeled anthropics/anthropic connects through an organization_id gauge to a single room named research.
The smallest useful configuration answers three questions. Which provider runs? Which organization must the login match? What workspace should exist?

For the direct Claude API, put this in main.tf in an empty directory. Use Terraform 1.11 or later and install the ant command-line tool. The official provider source is anthropics/anthropic. The plural in the first half matters because the installed plug-in has access to your credentials. Provider quickstart

Hcl
terraform {
  required_providers {
    anthropic = {
      source = "anthropics/anthropic"
    }
  }
}

variable "organization_id" {
  type = string
}

provider "anthropic" {
  organization_id = var.organization_id
}

resource "anthropic_workspace" "research" {
  name = "research"
}

As an organization admin, run ant auth login --profile admin --scope org:admin. Clear any leftover ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN from that shell, since either takes precedence over the active login. Set TF_VAR_organization_id to your organization ID from ant auth status. Run terraform init, then terraform plan. Check that the plan proposes creating only the intended workspace. If the credentials belong to another organization, the provider stops before it can plan. If the workspace already exists, use the import procedure below.

Once the plan has approval, run terraform apply and inspect the proposed change before confirming. A fresh plan should report No changes. Commit the configuration and the generated .terraform.lock.hcl file so the next engineer installs the same provider release.

What the provider can manage

There are two owners to think about. An organization admin sets up workspaces and identities. Inside a workspace, an agent owner configures the agent and the resources it uses across sessions. An organization needs Claude Managed Agents access to use that second group. These are the resource names in the provider behavior guide.

What you want to manageTerraform resource types
Workspaces and the people assigned to themanthropic_workspace, anthropic_workspace_member
Service accounts and their workspace rolesanthropic_service_account, anthropic_workspace_service_account
Trusted identity issuers, access rules and the workspaces where a rule is enabledanthropic_federation_issuer, anthropic_federation_rule, anthropic_federation_rule_workspace
External encryption key registrations and destinations for OpenTelemetry dataanthropic_external_key, anthropic_beta_telemetry_destination
Agents and the environments where their tools runanthropic_beta_agent, anthropic_beta_environment
Vaults, their credentials and reusable skillsanthropic_beta_vault, anthropic_beta_vault_credential, anthropic_skill
Memory stores, individual memory documents and scheduled deploymentsanthropic_beta_memory_store, anthropic_beta_memory, anthropic_beta_deployment

For Developer API keys, invitations and usage reports, use the Admin API directly. An individual agent session also sits outside Terraform. Your application can start a session using the agent and environment IDs that Terraform outputs.

Choose credentials for the platform you actually use

Direct Claude API. At a terminal, use ant auth login for workspace work and a separate admin profile for organization work. In a pipeline, use Workload Identity Federation. This lets a job exchange proof of its identity for a short-lived access token. Set ANTHROPIC_PROFILE to a federation profile that names the rule, service account, organization and token file. On GitHub Actions, the profile saves the token for the second connection during apply. Pinning profile in the provider block explicitly selects that identity. Authentication guide and team configuration

For a federated job managing agents, grant workspace:developer. For organization provisioning, the service account needs the admin organization role and a rule granting org:admin. Create that privileged rule in the Claude Console. An Admin API key can manage workspaces, members, external keys and telemetry destinations. Service accounts and federation resources require an org:admin token. A workspace-scoped Developer API key can manage agents.

Cloud accounts. Choose the platform explicitly. The two AWS offerings use different resource types and give the operator different jobs.

PlatformHow the provider signs inWhat to plan around
Claude Platform on AWSSet platform = "aws", aws_region, aws_account_id and an existing workspace_id. Requests use the default AWS credential chain or aws_profile, with AWS IAM permissions. An account mismatch stops the run.Create the first workspace in the AWS Console. Terraform can create further workspaces in the region and manage external keys, telemetry destinations and the listed Managed Agents resources except scheduled deployments. Workspace memberships, service accounts and federation rules are outside this platform's resource list.
Claude Models on Google Cloud (Anthropic managed)Set platform = "google_cloud", google_cloud_project and workspace_id. Application Default Credentials supply the identity. It needs project IAM permissions, including roles/claude.admin for an external key.Use the Default Workspace or create one in the Claude Console. Terraform can read workspaces, register an external key and manage all eight Managed Agents types listed above, including deployments. Workspace creation, memberships, service accounts, federation and telemetry destinations stay outside its scope here.
Claude Managed Agents on Amazon BedrockSet platform = "bedrock", aws_region and aws_account_id. Use the AWS credential chain or aws_profile. Leave AWS_BEARER_TOKEN_BEDROCK unset. Optional workspace_id identifies a Bedrock project and defaults to default.Only anthropic_beta_bedrock_agent, anthropic_beta_bedrock_memory_store and anthropic_beta_bedrock_memory and their data sources are available. Arrange IAM roles and Bedrock projects separately.

Claude Platform on AWS and Claude Models on Google Cloud also list anthropic_beta_skill, anthropic_compliance_settings and a models lookup. Google adds workspace and rate-limit lookups. A lookup reads a value. It gives you no ability to change that value. If your deployment ticket just says “AWS,” settle whether the agent runs on Bedrock or the Claude API before writing its configuration.

Five jobs worth putting through review

1. Open a workspace for each agency client. This is the best first use for a team on the direct API. Reuse an organization configuration for the client workspace, its service account, its membership and its federation rule. Reuse an existing issuer if clients share one. The reviewer can check the client name, the repository allowed to deploy and the role before onboarding goes ahead. Record the hours spent setting up and verifying the next client against the last manual onboarding. That gives the agency its own basis for pricing the work.

A workspace and federation rule on the upper bench lead to a workspace identity and agent on the lower bench.
New client setup takes two configurations. Create the workspace and its access rule first. Use an identity for that workspace to plan and apply the agent configuration.

The split matters because the provider authenticates before planning. A credential for a workspace that hasn't been created yet cannot plan its agent. On the second configuration, set workspace_id as a check. On the direct API the credential selects the workspace, and the check stops a run aimed at the wrong client.

2. Require approval before changing a production agent. A support lead proposes turning on web fetch for an agent. The pull request shows the tool change alongside the agent's instructions. Give routine production write access only to the deployment job, require review on the protected branch, and limit its federation rule to the intended repository, owner, branch and event. Those access decisions make review enforceable. Applying an agent change publishes a new version. A session pinned to a version stays there, while a session specifying only the agent ID uses the latest. Make the rollout choice part of the review. For a team already using the CLI, compare the agent configuration review workflow with ant apply.

3. Adopt an existing workspace. A platform lead inheriting a live account can bring it into Terraform without creating a duplicate. Every resource listed in the behavior guide supports import. Get its import ID format from the Terraform Registry reference. Add an import block with the resource address under to and the existing ID under id. Run terraform plan -generate-config-out=generated.tf. For more complex imports, fill in missing skill files, write-only secrets and sensitive URLs where needed. Review the plan before applying to finish the import. The same procedure helps after an interrupted create if the object exists but Terraform lost track of it. Import and recovery instructions

4. Check a departing client's access. An agency lead can review removal of workspace memberships before archiving anything. Destroying a workspace permanently archives its Developer API keys too. Deletion protection on the workspace defaults to on. Disabling it takes its own apply before a later operation can archive the workspace. That gives the lead a specific point to verify the client's handover.

5. Find changes between releases. A platform engineer can schedule a plan to find drift, meaning differences between the file and the live setup. Review unexpected changes with the person who made them before applying anything. Keep the plan private. Terraform state, its record of the resources it manages, can hold system prompts, tool definitions and memory contents. Store it in an encrypted, access-controlled remote backend with locking. Treat saved plans as secrets too.

Two things a platform team could sell

Start with a client workspace onboarding kit. An agency technical lead could buy a reusable module and a handover service. The smallest sellable version takes a client name and repository identity, proposes the workspace and access rule, then hands the workspace ID to a separately approved agent configuration. The adjacent market has a concrete price anchor. Spacelift Starter includes a private module registry and starts at $399 a month. Its Business tier adds templates and blueprints. An agency already paying for that tooling would need a reason to buy the kit. Offer the tested Claude configuration and first client handover inside the agency's existing system. The first sales question is how often the agency repeats the job. Spacelift pricing

An agent-change reviewer could fit inside an existing pull request. For a platform lead responsible for multiple agents, a small integration could turn a proposed change into three review questions. Which client's agent changes? Which tool permission changes? Which sessions will pick up the new version? Start with a private repository and an allowlist of fields safe to display. The Atlantis Terraform pull request automation project had 9.4k GitHub stars on December 5, evidence of interest in reviewing infrastructure this way. Claude-specific willingness to pay is still an open question. A pilot should test whether reviewers catch a rollout mistake they would otherwise miss. Atlantis project repository

What beta means for the next upgrade

Resource types and arguments can change during beta, and even a minor release can introduce an incompatible change. Commit the lock file and use terraform init -upgrade deliberately. Try the upgrade against a nonproduction workspace and read the plan before rolling it across client accounts. For a single, rarely changed workspace, the cost of maintaining that process may outweigh the setup time you save.

Can GitHub Actions run Terraform?

Yes. On the direct Claude API, use a federation profile tied to the job's identity. Check that an exported API key or auth token isn't silently overriding the selected profile.

Is Terraform for AWS only?

No. This provider supports the direct Claude API, Claude Models on Google Cloud (Anthropic managed), Claude Platform on AWS and Managed Agents on Amazon Bedrock. Choose the platform before designing a shared client template.

How can I automate the deployment process?

For a Claude agent, have the pipeline plan the proposed change, require approval, then let an authorized job apply the reviewed configuration. Decide separately whether session callers follow the latest agent version or pin a specific one.

If the client's next question is what happens to its data, use the enterprise agent data-retention comparison. For help putting this review workflow into production, see AI production systems.

Published
Category
Build
Related Articles
Codex CLI Cloud

Codex CLI Cloud

Start and reopen Codex cloud chats from the terminal, choose a project environment, and review local and cloud tasks in the Agent Command Center.BuildDec 5
GPT-Live API: Build a Voice App With WebRTC, a Sideband and Delegation

GPT-Live API: Build a Voice App With WebRTC, a Sideband and Delegation

Build a voice app on the GPT-Live API: open a WebRTC session, attach a sideband, delegate to a backend, keep state, test it and price each call.BuildDec 5
AI SDK 7.1 for TypeScript agents: what to adopt first

AI SDK 7.1 for TypeScript agents: what to adopt first

Which AI SDK 7.1 features belong in your agent? Start with tool ordering and steering, check your 7.0 patch, then choose batch, audio or durable execution.BuildDec 5
Codex Models by Surface and Task

Codex Models by Surface and Task

Choose a Codex model for your task and plan, see where GPT-5.6 threads go, and set a default or a one-run CLI override.BuildDec 5
Claude Settings JSON

Claude Settings JSON

Find Claude Code’s settings.json, see which file wins, and copy five examples for permissions, hooks, models, the status line and compaction.BuildDec 5
How to Run Qwen 4 Locally

How to Run Qwen 4 Locally

Run Qwen4-35B-A3B with Ollama, LM Studio, llama.cpp or vLLM. Match GGUF sizes to your GPU or Mac and leave room for context.BuildDec 5
OpenRouter API Key: Create a Key and Send Your First Request

OpenRouter API Key: Create a Key and Send Your First Request

Create an OpenRouter API key, set a spending limit, and send your first request with curl or the OpenAI Python SDK. See the documented reply and error fixes.BuildDec 5
OpenAI Health Alerts

OpenAI Health Alerts

Choose an OpenAI API alert for errors, cache misses, rate limits or Fast tier spillover. Set its scope and route triggers and recoveries to the right team.BuildDec 4
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.