npx skills add ...
npx skills add aws/agent-toolkit-for-aws --skill agents-deploy
npx skills add aws/agent-toolkit-for-aws --skill agents-deploy
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.
Deploy your AgentCore agent to AWS, or diagnose why a deploy failed.
agentcore deploy failed with an error$ARGUMENTS is optional:
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:
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:
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:
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.
--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:
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:
If the developer pasted an error, diagnose it directly. If not, read the deploy logs:
IAM permission error:
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:
Fix:
ECR authorization error:
Fix:
Model access denied during deploy:
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:
Fix: Update agentcore/aws-targets.json to match your aws configure default region, or run aws configure set region <REGION>.
Memory stuck in CREATING:
This is unusual — normal provisioning takes 2–5 minutes. Check:
If stuck, try removing and re-adding the memory resource.
Service quota exceeded:
Fix: Request a quota increase in the AWS console → Service Quotas → Amazon Bedrock AgentCore.
If the same error recurs, check agentcore status to see the current state of all resources:
Define targets in agentcore/aws-targets.json:
Deploy to a specific target:
aws bedrock list-foundation-models --region $(aws configure get region) \
--query 'modelSummaries[?modelLifecycle.status==`ACTIVE`].modelId' \
--output tableagentcore deploy --dry-run
agentcore deploy --diffaws 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 targetagentcore status --type memory# View recent deploy logs
ls -lt agentcore/.cli/logs/
cat agentcore/.cli/logs/deploy-*.log 2>/dev/null | tail -100User: arn:aws:iam::123456789012:user/dev is not authorized to perform: iam:CreateRoleThis stack uses assets, so the toolkit stack must be deployed to the environmentnpx cdk bootstrap aws://<YOUR_ACCOUNT_ID>/<REGION>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.comValidationException: The provided model identifier is invalidStack ... is in region us-east-1 but the target is us-west-2Memory resource is in CREATING state after 10 minutesagentcore status --type memory --jsonLimitExceededException: Account limit for AgentCore runtimes exceededagentcore deploy -yagentcore status
agentcore status --state pending-removal # resources marked for deletion[
{
"name": "staging",
"description": "Staging environment",
"account": "123456789012",
"region": "us-east-1"
},
{
"name": "production",
"description": "Production environment",
"account": "987654321098",
"region": "us-west-2"
}
]agentcore deploy --target staging -y
agentcore deploy --target production -y