次のような場合に使用: - エージェント(AI業務自動化システム)を AWS にデプロイ(システム導入)する場合 - デプロイが失敗した場合 **対応機能:** - デプロイ前の検証 - CDK・IAM・クォータ(利用枠)エラーの診断 - バージョン管理 - ロールバック(前の状態への戻し) - カナリアデプロイ(段階的な検証導入) **起動トリガー:** 「エージェントをデプロイして」「agentcore deploy」「デプロイ失敗」「CDK エラー」「ロールバック」「カナリアデプロイ」「バージョン固定」「再デプロイ」「デプロイが進まない」 **対応外:** - 本番環境の堅牢化(agents-harden を使用) - デプロイ前の機能追加(agents-build または agents-connect を使用) - VPC 設定エラー(agents-build を使用)
Use when deploying your agent to AWS, or when a deploy has failed. Handles pre-flight validation, CDK/IAM/quota error diagnosis, version management, rollback, and canary deployments. Triggers on: "deploy my agent", "agentcore deploy", "deploy failed", "CDK error", "rollback", "canary deploy", "pin version", "redeploy", "deploy stuck". Not for production hardening — use agents-harden. Not for adding capabilities before deploy — use agents-build or agents-connect. Not for VPC configuration errors — use agents-build.
AgentCoreのagentをAWSにデプロイする、またはデプロイ失敗の原因を診断します。
agentcore deploy がエラーで失敗した$ARGUMENTS は省略可能です:
/agents-deploy # 対話形式 — デプロイ前チェックまたは失敗の診断
/agents-deploy preflight # デプロイ前にconfigとIAMを検証
/agents-deploy diagnose # 失敗したデプロイを診断(エラーを貼り付けるかログを読み込む)
/agents-deploy preview # 実際にデプロイせずにデプロイ内容を表示
/agents-deploy rollback # 以前のバージョンにロールバック
agentcore --version を実行してください。このスキルにはv0.9.0以降が必要です。
バージョンが古い場合は、処理を進める前に agentcore update を実行するよう開発者に伝えてください。
agentcore/agentcore.json と agentcore/aws-targets.json が存在する場合はこれらを読み込みます。
以下を確認します(または文脈から推測します):
「現在の状況を教えてください:
- これからデプロイしようとしており、事前にすべてを確認したい
- デプロイが失敗した — どのようなエラーが表示されましたか?
- ロールバックまたは特定バージョンへの固定が必要」
バージョニング、ロールバック、またはカナリアデプロイが必要な場合は、references/versioning.md を読み込み、その指示に従ってください。
agentcore deploy の実行前に以下のチェックを行います:
開発者に以下のコマンドを実行してもらいます:
agentcore validate
CDKが起動する前に、agentcore.json の不正な記述を検出します。
デプロイ失敗の最も一般的な原因はリージョンの不一致です。 開発者に以下のコマンドで確認してもらいます:
# 設定されているAWSリージョン
aws configure get region
# デプロイターゲットのリージョン
cat agentcore/aws-targets.json
# 現在認証されているアカウント
aws sts get-caller-identity
aws-targets.json の region は aws configure のデフォルトリージョンと一致している必要があります。
また account は sts get-caller-identity のアカウントIDと一致している必要があります。
開発者に以下のコマンドで、自分のリージョンで有効なモデルを確認してもらいます:
aws bedrock list-foundation-models --region $(aws configure get region) \
--query 'modelSummaries[?modelLifecycle.status==`ACTIVE`].modelId' \
--output table
クロスリージョン推論プロファイルIDは、推論の実行場所を制御するために地理的プレフィックス(us.、eu.、apac.)または global. を使用します。
CLIはデフォルトで global. をスキャフォールドします(例: global.anthropic.claude-sonnet-4-5-20250929-v1:0)。これは任意の商用リージョンにルーティングされます。
地理的プレフィックスを使用すると、推論をその地域内に限定できます(例: eu. はEUリージョン内に留まります)。
いずれのプレフィックスも、そのプロファイルが対象とするすべてのデスティネーションリージョンでモデルアクセスが有効になっている必要があります。
各プロファイルプレフィックスに含まれるリージョンについては、Bedrockのドキュメントを確認してください。
agentcore deploy --dry-run
agentcore deploy --diff
--dry-run は作成されるリソースを表示します。
--diff は現在デプロイされている状態との差分をCDK形式で表示します。
必要なパーミッションと以下の確認コマンドを開発者に提示します:
aws iam simulate-principal-policy \
--policy-source-arn $(aws sts get-caller-identity --query Arn --output text) \
--action-names iam:CreateRole \
--resource-arns "arn:aws:iam::*:role/*BedrockAgentCore*"
agentcore deploy -y # 自動確認(エイリアス: agentcore dp -y)
agentcore deploy -y -v # 詳細表示 — リソースレベルのイベントを表示
agentcore deploy --target staging -y # 特定のターゲットにデプロイ
メモリプロビジョニングについて: プロジェクトにメモリが含まれる場合、メモリリソースがACTIVE状態になるまでの間、デプロイに2〜5分余分にかかります。 これは正常な動作であり、エラーではありません。以下のコマンドで状態を確認できます:
agentcore status --type memory
開発者がエラーを貼り付けた場合は、直接診断します。 そうでない場合は、デプロイログを確認します:
# 最近のデプロイログを表示
ls -lt agentcore/.cli/logs/
cat agentcore/.cli/logs/deploy-*.log 2>/dev/null | tail -100
IAMパーミッションエラー:
User: arn:aws:iam::123456789012:user/dev is not authorized to perform: iam:CreateRole
対処法: 必要なIAMパーミッションを付与してください(上記チェック5を参照)。
デプロイを実行するIDには、*BedrockAgentCore* ロールにスコープされたIAM書き込みアクセスが必要です。
CDK bootstrapの未実行:
This stack uses assets, so the toolkit stack must be deployed to the environment
対処法:
npx cdk bootstrap aws://<YOUR_ACCOUNT_ID>/<REGION>
ECR認証エラー:
no basic auth credentials
Error response from daemon: Head "https://<YOUR_ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com/..."
対処法:
aws ecr get-login-password --region <REGION> | \
docker login --username AWS --password-stdin <YOUR_ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com
デプロイ中のモデルアクセス拒否:
ValidationException: The provided model identifier is invalid
対処法: BedrockコンソールのModel accessでモデルを有効化してください。
agentcore.json のモデルIDが、ターゲットリージョンで有効なモデルと一致していることを確認してください。
リージョンの不一致:
Stack ... is in region us-east-1 but the target is us-west-2
対処法: agentcore/aws-targets.json を aws configure のデフォルトリージョンに合わせて更新するか、
aws configure set region <REGION> を実行してください。
メモリがCREATING状態のまま停止:
Memory resource is in CREATING state after 10 minutes
これは通常の動作ではありません(正常なプロビジョニングは2〜5分で完了します)。 以下のコマンドで状態を確認してください:
agentcore status --type memory --json
停止している場合は、メモリリソースを削除して再追加してみてください。
サービスクォータの超過:
LimitExceededException: Account limit for AgentCore runtimes exceeded
対処法: AWSコンソール → Service Quotas → Amazon Bedrock AgentCoreからクォータの引き上げをリクエストしてください。
agentcore deploy -y
同じエラーが再発する場合は、agentcore status で全リソースの現在の状態を確認してください:
agentcore status
agentcore status --state pending-removal # 削除対象としてマークされたリソース
agentcore/aws-targets.json にターゲットを定義します:
[
{
"name": "staging",
"description": "ステージング環境",
"account": "123456789012",
"region": "us-east-1"
},
{
"name": "production",
"description": "本番環境",
"account": "987654321098",
"region": "us-west-2"
}
]
特定のターゲットにデプロイするには:
agentcore deploy --target staging -y
agentcore deploy --target production -y
Deploy your AgentCore agent to AWS, or diagnose why a deploy failed.
agentcore deploy failed with an error$ARGUMENTS is optional:
/agents-deploy # interactive — pre-flight check or diagnose failure
/agents-deploy preflight # validate config and IAM before deploying
/agents-deploy diagnose # diagnose a failed deploy (paste error or read logs)
/agents-deploy preview # show what deploy will create without deploying
/agents-deploy rollback # roll back to a previous version
Run agentcore --version. This skill requires v0.9.0 or later. If the version is older, tell the developer to run agentcore update before proceeding.
Read agentcore/agentcore.json and agentcore/aws-targets.json if they exist.
Ask (or infer from context):
"Are you:
- About to deploy and want to check everything first
- Dealing with a failed deploy — what error did you see?
- Needing to roll back or pin a specific version?"
If the developer needs versioning, rollback, or canary deployment, load references/versioning.md and follow its instructions.
Run these checks before agentcore deploy:
Show the developer this command to run:
agentcore validate
This catches malformed agentcore.json before CDK even starts.
The most common deploy failure is a region mismatch. Show the developer these commands to verify:
# Your configured AWS region
aws configure get region
# The region in your deployment target
cat agentcore/aws-targets.json
# The account you're actually authenticated as
aws sts get-caller-identity
The region in aws-targets.json must match your aws configure default region. The account must match the account ID from sts get-caller-identity.
Show the developer this command to check enabled models in their region:
aws bedrock list-foundation-models --region $(aws configure get region) \
--query 'modelSummaries[?modelLifecycle.status==`ACTIVE`].modelId' \
--output table
Cross-region inference profile IDs use a geographic prefix (us., eu., apac.) or global. to control where inference runs. The CLI scaffolds global. by default (e.g., global.anthropic.claude-sonnet-4-5-20250929-v1:0), which routes to any commercial region. Geographic prefixes keep inference within that geography (e.g., eu. stays in EU regions). All prefixes require model access enabled in every destination region the profile covers. Check the Bedrock docs for which regions are included in each profile prefix.
agentcore deploy --dry-run
agentcore deploy --diff
--dry-run shows what resources will be created. --diff shows the CDK diff against what's currently deployed.
Show the developer the permissions needed and this verification command:
aws iam simulate-principal-policy \
--policy-source-arn $(aws sts get-caller-identity --query Arn --output text) \
--action-names iam:CreateRole \
--resource-arns "arn:aws:iam::*:role/*BedrockAgentCore*"
agentcore deploy -y # auto-confirm (alias: agentcore dp -y)
agentcore deploy -y -v # verbose — shows resource-level events
agentcore deploy --target staging -y # deploy to a specific target
Memory provisioning note: If your project includes memory, deploy takes 2–5 minutes longer while the memory resource becomes ACTIVE. This is normal — not an error. Check status:
agentcore status --type memory
If the developer pasted an error, diagnose it directly. If not, read the deploy logs:
# View recent deploy logs
ls -lt agentcore/.cli/logs/
cat agentcore/.cli/logs/deploy-*.log 2>/dev/null | tail -100
IAM permission error:
User: arn:aws:iam::123456789012:user/dev is not authorized to perform: iam:CreateRole
Fix: Attach the required IAM permissions (see Check 5 above). The deploying identity needs IAM write access scoped to *BedrockAgentCore* roles.
CDK bootstrap not run:
This stack uses assets, so the toolkit stack must be deployed to the environment
Fix:
npx cdk bootstrap aws://<YOUR_ACCOUNT_ID>/<REGION>
ECR authorization error:
no basic auth credentials
Error response from daemon: Head "https://<YOUR_ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com/..."
Fix:
aws ecr get-login-password --region <REGION> | \
docker login --username AWS --password-stdin <YOUR_ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com
Model access denied during deploy:
ValidationException: The provided model identifier is invalid
Fix: Enable the model in the Bedrock console → Model access. Ensure the model ID in agentcore.json matches an enabled model in your target region.
Region mismatch:
Stack ... is in region us-east-1 but the target is us-west-2
Fix: Update agentcore/aws-targets.json to match your aws configure default region, or run aws configure set region <REGION>.
Memory stuck in CREATING:
Memory resource is in CREATING state after 10 minutes
This is unusual — normal provisioning takes 2–5 minutes. Check:
agentcore status --type memory --json
If stuck, try removing and re-adding the memory resource.
Service quota exceeded:
LimitExceededException: Account limit for AgentCore runtimes exceeded
Fix: Request a quota increase in the AWS console → Service Quotas → Amazon Bedrock AgentCore.
agentcore deploy -y
If the same error recurs, check agentcore status to see the current state of all resources:
agentcore status
agentcore status --state pending-removal # resources marked for deletion
Define targets in agentcore/aws-targets.json:
[
{
"name": "staging",
"description": "Staging environment",
"account": "123456789012",
"region": "us-east-1"
},
{
"name": "production",
"description": "Production environment",
"account": "987654321098",
"region": "us-west-2"
}
]
Deploy to a specific target:
agentcore deploy --target staging -y
agentcore deploy --target production -y
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。