Anthropic 公式 Terraform provider がパブリックベータでリリースされたので試してみた

Anthropic 公式 Terraform provider がパブリックベータでリリースされたので試してみた

2026.12.04

Anthropic 公式の Terraform provider(anthropics/anthropic)が公開されました(パブリックベータ)。

Claude Platform(Claude Console)と Claude Enterprise のリソースを Terraform で管理できます。Claude Platform では、Workspace やサービスアカウントなどの組織の管理と、Managed Agents のエージェント、環境、Vault などが対象です。

Claude Enterprise は、v0.1.0(2026年12月時点)では管理画面で設定する項目の一部だけが対象です。RBAC グループとそのメンバー、ユーザー毎の支出上限、Claude Tag の Slack 設定などはリソースがあります。SSO、コネクタ、Claude Code の管理設定、ロールの割り当てなどはリソースがありません。

今回は Claude Platform の Managed Agents の環境を Terraform で作成してみました。

Anthropic Provider

Terraform Registry のドキュメントでは、この provider が管理するのは組織のリソース(Workspace やサービスアカウントなど)と、Managed Agents のリソース(エージェント、環境、Vault など)と説明されています。

必要な認証情報はリソースによって違います。ドキュメントの Authentication にある表を日本語でまとめると、次のようになります。

リソース 認証情報
Managed Agents(エージェント、環境、Vault、メモリストア、スキルなど) Workspace の API キーかプロファイル
Workspace とそのメンバー、暗号化キー、OpenTelemetry の送信先、組織の Webhook Admin API キーか、org:admin スコープ付きのプロファイル
サービスアカウント、フェデレーション org:admin スコープ付きのプロファイル
RBAC、プラグインマーケットプレイス、Claude Tag Enterprise Admin API キー(機能ごとのスコープ付き)
MCP トンネルとその証明書 workspace:manage_tunnels か org:admin スコープ付きのフェデレーションプロファイル

Claude Enterprise の組織を対象にしたリソースは次のとおりです。(2026年12月時点)

  • anthropic_rbac_group / anthropic_rbac_group_member
  • anthropic_beta_spend_limit
  • anthropic_beta_claude_tag_slack_workspace / anthropic_beta_claude_tag_slack_channel / anthropic_beta_claude_tag_bundle_target

プラグインマーケットプレイスはデータソース(anthropic_beta_plugin_marketplace / anthropic_beta_plugin_marketplaces)だけで、読み取りのみです。

やってみた

準備

必要なものは Terraform 1.11 以降と ant CLI です。ant をインストールします。

brew install anthropics/tap/ant
ant auth login

ant auth login でブラウザが開き、Claude Console にログインします。

Authorize_Application___Claude_Platform.png

ANTHROPIC_API_KEY や ANTHROPIC_AUTH_TOKEN が設定されていると、ログインより優先されます。設定済みなら unset しておきます。

provider の設定には組織 ID が必要です。ant auth status の出力で確認できます。Console の 設定 -> 組織 でも見られます。

Organization
  (active) * Profile organization_id                        <ORGANIZATION_ID>

Organization___Claude_Platform.png

Terraform ファイルを書く

公式ドキュメントの quickstart にある環境のブロックを、そのまま使います。環境はエージェントのツールが動く、隔離されたクラウドコンテナです。ここではパッケージマネージャーだけを許可する、制限付きのネットワークにしました。

main.tf
terraform {
  required_version = ">= 1.11"
  required_providers {
    anthropic = {
      source = "anthropics/anthropic"
    }
  }
}

variable "organization_id" {
  type = string
}

provider "anthropic" {
  organization_id = var.organization_id
}

resource "anthropic_beta_environment" "sandbox" {
  name        = "tf-verify"
  description = "Cloud sandbox for Terraform provider verification."

  config = {
    cloud = {
      networking = {
        limited = {
          allow_package_managers = true
        }
      }
    }
  }
}

環境を作成する

組織 ID を実行時にTF_VAR_で渡す方法でやりました。

export TF_VAR_organization_id=<ORGANIZATION_ID>
terraform init
terraform plan
terraform apply

plan を見ると、環境の deletion_protection が true になっています。削除保護がデフォルトは有効で設定されます。(今回は明示的に指定しなかったのでデフォルト値が入りました)

  # anthropic_beta_environment.sandbox will be created
  + resource "anthropic_beta_environment" "sandbox" {
      # ...省略...
      + deletion_protection = true
      # ...省略...
      + name                = "tf-verify"
      # ...省略...
    }

apply が完了しました。

anthropic_beta_environment.sandbox: Creating...
anthropic_beta_environment.sandbox: Creation complete after 1s [id=env_<ENVIRONMENT_ID>]

コンソールの エージェント -> 環境 に今回作成したtf-verityが表示されました。

Environments.png

Environments___Claude_Platform.png

plan ・ apply のたびに(リソース作成前(初回 apply 前) の plan も含む)、対象の組織を示す Warning が出ます。消す方法については、見つけることができませんでした。

Warning: Anthropic organization

# ...省略...

This run reads and changes resources in organization
<ORGANIZATION_ID>.

環境を削除する

そのまま terraform destroy を実行すると、エラーで止まります。削除保護がデフォルトで有効なためです。

削除保護を無効にします。deletion_protection = false を追加して apply します。

main.tf
 resource "anthropic_beta_environment" "sandbox" {
   name        = "tf-verify"
   description = "Cloud sandbox for Terraform provider verification."
+
+  deletion_protection = false
terraform apply
terraform destroy

続けて destroy を実行すると、環境が削除されました。

Destroy complete! Resources: 1 destroyed.

Environments.png

おわりに

待望の公式 Anthropic プロバイダーがリリースされました。

Claude Enterprise の管理画面の設定項目を Terraform で管理したいと思っていたので、嬉しいリリースです。

現時点では Claude Enterprise の対応リソースは少ないですが、今後拡大していくと思うので楽しみです。


Claudeならクラスメソッドにお任せください

クラスメソッドは、Anthropic社とリセラー契約を締結しています。各種製品ガイドから、業種別の活用法、フェーズごとのお悩み解決などサービス支援ページにまとめております。まずはご覧いただき、お気軽にご相談ください。

サービス詳細を見る

この記事をシェアする

AI白書

関連記事