Home  ›  Insights  ›  Claude in Terraform
Field Note

Claude in Terraform, explained: four things to check first

Anthropic now has an official Terraform provider, in beta. Your Claude workspaces, service accounts, and agents can live in a reviewed file instead of a console. That is a real gain. The same file can also expose your agents’ prompts and archive things for good. Here is what it does, in plain English, and the four things to check before you switch it on.

Box files: a workspace, an agent, a vaultOrange flap: deletion protection, on by defaultRed strips: archived, no undoCounts are this figure's model and illustrative. Anthropic's docs say deletion_protection is on by default, including on imported resources, that terraform destroy fails while it is on, and that destroying a workspace archives it and its Developer API keys permanently (vendor).

What shipped, in plain English

In one line: you write down what your Claude setup should look like, Terraform shows you what it will change, and nothing changes until you approve.

Terraform is a tool that reads a text file describing what should exist, shows you a plan of the changes, and makes them when you approve. It remembers what it built in a state file.

Anthropic’s provider teaches Terraform about the Claude Platform. You can now write into that file your workspaces, who is in them, the service accounts your pipelines use, and Claude Managed Agents with their environments, vaults, skills, memory, and schedules (vendor). AlphaSignal reported the public beta on 3 December (independent). Anthropic’s docs give no release date.

What changes for you: Claude stops being something people click together in a console. It becomes a file in a repository, reviewed like code, with a history of who changed what. The rest of this note is what that file can also do to you.

What you can write down as code

AreaExamples in the docsWhat terraform destroy does
OrganisationWorkspaces, workspace members, service accounts, CI sign-in rules, encryption keys, and OpenTelemetry destinationsArchives a workspace and its Developer API keys permanently; archives service accounts and sign-in rules permanently (vendor)
AgentsAgents, environments, vaults and their credentials, skills, memory stores, and scheduled deploymentsArchives an agent permanently, with its deployments; deletes a skill and every version of it (vendor)
Look-upsModels, rate limits, workspaces, and organisation usersNothing: these only read

The docs say the provider has more resource types than they describe, and the Terraform Registry lists them all. It needs Terraform 1.11 or later and Anthropic’s ant command-line tool (vendor).

Which sign-in can change what

This is where teams trip first. The Admin API key you already hold does not reach everything.

Sign-inWhat it can manage (vendor)
A workspace Developer API keyAgents and the other Managed Agents resources in that workspace. Nothing organisation-wide.
An Admin API keyWorkspaces, members, encryption keys, and telemetry destinations. Not agents, service accounts, or CI sign-in rules.
An org:admin sign-in, from ant auth login --scope org:admin or a CI identity with that scopeOrganisation resources, including service accounts and CI sign-in rules.

Every provider block names your organisation ID, and the provider refuses to plan if the credentials belong to a different organisation (vendor). That stops a laptop signed in to the wrong organisation from changing yours. Never paste a key into the file: the docs warn that anything written in the provider block also ends up in plan files.

For pipelines, GitHub Actions can sign in without a stored key, through workload identity federation. Use a federation profile, not the federation environment variables: the docs say terraform apply otherwise fails on GitHub Actions, because the API accepts a GitHub Actions token only once by default (vendor).

Four things to check first

1. The state file holds your agents’ instructions

Terraform’s state file keeps what it manages in plain text. For Claude that includes system prompts, custom tool schemas, memory content, and skill content, plus your workspace layout and CI sign-in rules (vendor). Anyone who can read the state can read how your agents are told to behave. Anthropic’s advice: an encrypted, versioned, locked remote backend, and never commit .tfstate.

2. Destroy is permanent, and protection is on by default

deletion_protection is on by default, including for resources you import, and terraform destroy fails while it is on (vendor). To remove something you switch protection off in one apply, then destroy in the next. Keep that two-step rule in your change process. An archived workspace takes its Developer API keys with it.

3. An agent change reaches every session that names only the agent

Every apply that changes an agent publishes a new version, and sessions that name only the agent’s ID use the latest one (vendor). A merged prompt edit is a production release. Pin the version wherever a change needs testing first.

4. Only one address is Anthropic’s

The docs say anthropics/anthropic is the only official source address, and that a provider installed from any other address runs with your Anthropic credentials and could read them (vendor). Community providers under other addresses exist: terraform-mars/anthropic on GitHub, for example, takes an Admin API key and does not state an affiliation (independent, its README). Check every required_providers block, modules included: the docs say a module without the official source falls back to hashicorp/anthropic, and terraform init fails.

Should you adopt it now?

Commercial decision: the provider is in beta. Anthropic says resource types and arguments can change, and that some backward-incompatible changes can ship in a minor version (vendor). Against that, agents clicked together in a console have no review and no history. Our call: use it now for workspaces and agents outside production, commit .terraform.lock.hcl so every machine runs the same release, and move production once the state backend and keyless CI sign-in are in place.

Running the platform is Anthropic’s job. What your state file exposes, and what your merges release, are yours.

Five steps

  1. Step 1. Choose where state lives. An encrypted, versioned, locked remote backend, readable only by people allowed to read agent prompts. Owner: platform lead.
  2. Step 2. Pin the provider. source = "anthropics/anthropic" in every required_providers block, organization_id in every provider block, and the lock file committed. Owner: platform engineer.
  3. Step 3. Import what already exists. Add an import block for each workspace and agent, run terraform plan -generate-config-out=generated.tf, and fill in what the generated file leaves out: secrets, skill files, and MCP server URLs (vendor). Owner: platform engineer.
  4. Step 4. Move CI to keyless sign-in. A service account, a GitHub Actions sign-in rule limited to your main branch, and a federation profile in the pipeline. Owner: security lead.
  5. Step 5. Check for drift on a schedule. Run terraform plan and terraform plan -refresh-only. The docs say a plain plan does not catch some console changes, such as someone enabling a CI sign-in rule in another workspace (vendor). Owner: platform lead.

Missing

  • A release date or version history: Anthropic’s docs give neither, so the date here is AlphaSignal’s report.
  • Per-resource arguments, which sit on the Terraform Registry and which we did not read.
  • When the beta ends.
  • Who maintains the community providers, and whether they are current.
  • A test run. We have not applied the provider; nothing on this page was measured by Prestanda.

Frequently asked questions

What does Anthropic’s Terraform provider do?

It lets you describe your Claude Platform setup, from workspaces and service accounts to Managed Agents, in Terraform files, review the planned changes, and apply them. It is in public beta and needs Terraform 1.11 or later.

Can I use my Admin API key with it?

For workspaces, members, encryption keys, and telemetry destinations, yes. Agents need a workspace Developer API key or a personal sign-in, and service accounts and CI sign-in rules need a sign-in with the org:admin scope.

Is the Terraform state file sensitive?

Yes. Anthropic’s docs say it holds system prompts, tool schemas, memory, and skill content in plain text. Keep it in an encrypted, versioned, locked remote backend and never commit it.

Can terraform destroy delete my Claude agents?

Only after you switch deletion protection off, which is on by default. Once it is off, destroying an agent archives it permanently, and destroying a workspace archives it with its Developer API keys.

Sources

Living page. Last updated 6 Dec 2026. We update this note when the beta ends, or when the provider’s sign-in rules or destroy behaviour change. Putting Claude agents into a reviewed pipeline? Talk to us.