Skip to main content
skill CX Codex

aws-deployment — Claude Code skill: what it does, how to install

Walks your coding agent through AWS CI/CD: CodePipeline, CodeBuild, CodeDeploy, CodeConnections, CodeArtifact. Useful when a pipeline stalls at source or a build hangs in a VPC.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add aws/agent-toolkit-for-aws --skill aws-deployment -a claude-code
Open on GitHub

What aws-deployment does

The skill hands the agent a map of the AWS build stack. CodeConnections pulls code from GitHub, GitLab or Bitbucket, CodeBuild compiles and tests it, CodeDeploy shifts traffic on EC2, ECS or Lambda, and CodePipeline chains the stages with approval gates in between. What ships is SKILL.md plus a references/ folder split by service: codepipeline.md, codebuild.md, codedeploy.md, codeartifact.md, codeconnections.md, troubleshooting.md.

Most of the content is warnings and failure tables. A connection created with the CLI or CloudFormation sits in PENDING forever until someone finishes OAuth in the AWS Console. There is no API-only path. So check the connection status before you start rewriting the pipeline definition.

It pairs with the AWS MCP server for running CLI commands and validating configs, and plain AWS CLI works as well. Cross-account deploys need all three pieces at once: a KMS key policy, an S3 bucket policy and a cross-account IAM role. Miss one and you get Access Denied with no hint about which. ECS Fargate, CDK Pipelines, sam deploy and GitHub Actions are left to sibling skills on purpose.

What it helps with

  • wire a CodePipeline from GitHub to ECS
  • write a buildspec.yml with build caching and Docker
  • pick a CodeDeploy strategy: blue/green, canary or linear
  • set up a private package registry in CodeArtifact
  • trace why a build hangs in a private subnet without NAT

Example prompts for the agent

  • Build a GitHub-to-ECS pipeline: CodeConnections source, CodeBuild build, CodeDeploy blue/green
  • The pipeline is stuck at Source — check the CodeConnections status
  • Set up a cross-account deploy with the KMS key policy, bucket policy and role

How to install aws-deployment

1Skills CLI (Vercel)

npx skills add aws/agent-toolkit-for-aws --skill aws-deployment -a claude-code

2Manually: put the files in place

~/.claude/skills/aws-deployment/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/aws-deployment/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about aws-deployment

How do I install aws-deployment in Claude Code?

Run npx skills add aws/agent-toolkit-for-aws --skill aws-deployment -a claude-code. The skill ends up at ~/.claude/skills/aws-deployment/SKILL.md.

What does aws-deployment do?

It tells the agent how to assemble AWS CI/CD: CodePipeline stages, the buildspec.yml contract, CodeDeploy traffic shifting, CodeArtifact private registries and CodeConnections for repo sources. It also covers recurring breakage, such as a connection stuck in PENDING.

Does it cover CDK Pipelines or GitHub Actions?

No. CDK Pipelines and cdk deploy point to the aws-cdk skill, ECS Fargate to aws-containers, sam deploy to aws-serverless. GitHub Actions and GitLab CI are outside its scope too.

What do I need for cross-account deployment?

Three things together: a customer-managed KMS key policy for the target account, an S3 bucket policy and a cross-account IAM role with a trust policy. Any missing piece surfaces as Access Denied.

Source text

SKILL.md · Apache-2.0
---
name: aws-deployment
description: "Configures CI/CD pipelines using AWS CodePipeline, CodeBuild, CodeDeploy, CodeConnections, and CodeArtifact. Covers CodePipeline V2 (triggers, variables, execution modes, cross-account), buildspec.yml (caching, VPC, Docker), CodeDeploy strategies (blue/green, canary, linear), CodeArtifact (private package registries, auth tokens, cross-account), and source connections (GitHub, GitLab, Bitbucket). Applies when CodePipeline, CodeBuild, CodeDeploy, CodeConnections, CodeArtifact, buildspec.yml, appspec.yml, or CI/CD pipeline orchestration is referenced. Does NOT cover: ECS Fargate services or task definitions (use aws-containers), CDK Pipelines or cdk deploy (use aws-cdk), sam deploy (use aws-serverless), Amplify deployments (use aws-amplify), or GitHub Actions/GitLab CI."
metadata:
  version: "1"
---

# AWS Deploy (CI/CD)

**Works best with** the [AWS MCP server](https://docs.aws.amazon.com/aws-mcp/) for running CLI commands and validating configurations directly. All guidance also works with standard AWS CLI.

## Critical Warnings

**CodeConnections PENDING trap**: Connections created via CLI/CloudFormation remain `PENDING` indefinitely — MUST complete OAuth in the AWS Console. No API-only path exists.

**Cross-account triple requirement**: Cross-account deploys need ALL THREE: (1) KMS key policy granting target account (use key ID, not alias), (2) S3 bucket policy for target account, (3) cross-account IAM role with trust policy. Missing any one = cryptic `Access Denied`.

**CodeDeploy ApplicationStop uses PREVIOUS revision**: Broken stop scripts in a prior deployment block ALL future deploys. Make stop scripts idempotent (exit 0 if service absent). Unblock with `--ignore-application-stop-failures`.

**CodeBuild VPC without NAT**: Builds in VPC subnets without NAT gateway hang at `DOWNLOAD_SOURCE` silently. Private subnets MUST have NAT gateway or VPC endpoints.

**CodeConnections IAM**: Use `codeconnections:` prefix for API calls and IAM policy Actions. Resource ARNs must match exactly — new resources use `codeconnections` prefix, existing resources may use `codestar-connections` prefix. Specify both in Resource if you have mixed-age resources.

**UseConnection is over-permissive**: `codeconnections:UseConnection` grants access to ALL repositories the connection can reach. MUST specify condition keys (`codeconnections:FullRepositoryId`, `codeconnections:ProviderAction`, `codeconnections:BranchName`) to limit CodeBuild to only the required repository.

## How These Services Compose

CodeConnections → CodeBuild → CodeDeploy, orchestrated by CodePipeline.

| Layer | Service | Role |
|-------|---------|------|
| Source | CodeConnections | Authenticates to GitHub/GitLab/Bitbucket, delivers code |
| Packages | CodeArtifact | Private package registry, dependency caching from public registries |
| Build/Test | CodeBuild | Compiles, tests, packages artifacts |
| Deploy | CodeDeploy | Deploys to EC2/ECS/Lambda with traffic shifting strategies |
| Orchestrator | CodePipeline | Chains stages, manages transitions, approval gates |

Default: V2 pipeline type with QUEUED execution mode. Use PARALLEL only when executions are fully independent.

## Quick Navigation

| You want to... | Go to |
|----------------|-------|
| Create a pipeline (V2, triggers, variables, modes) | [codepipeline.md](references/codepipeline.md) |
| Connect GitHub/GitLab/Bitbucket source | [codeconnections.md](references/codeconnections.md) |
| Write buildspec.yml / configure builds | [codebuild.md](references/codebuild.md) |
| Set up private package registry for builds | [codeartifact.md](references/codeartifact.md) |
| Configure deployment strategy (blue/green, canary) | [codedeploy.md](references/codedeploy.md) |
| Cross-account or cross-region deployment | [codepipeline.md](references/codepipeline.md) |
| Fix failing pipeline, build, or deployment | [troubleshooting.md](references/troubleshooting.md) |

## Common Workflows

| Task | Action | Reference |
|------|--------|-----------|
| Pipeline from GitHub to ECS | Create connection → CodeBuild Docker stage → CodeDeploy ECS blue/green | [codepipeline](references/codepipeline.md), [codedeploy](references/codedeploy.md) |
| Pipeline stuck at source | Check connection status; if PENDING, complete OAuth in AWS Console | [troubleshooting](references/troubleshooting.md) |
| Build timing out | Check VPC/NAT, increase `timeoutInMinutes`, verify Docker privileged mode | [codebuild](references/codebuild.md) |
| Deploy to another account | Configure KMS + S3 bucket policy + cross-account role, add `RoleArn` to action | [codepipeline](references/codepipeline.md) |
| Roll back failed deployment | Auto-rollback on alarm/failure; manual: `stop-deployment --auto-rollback-enabled` | [codedeploy](references/codedeploy.md) |
| Lambda canary deployment | CodeBuild packages → CodeDeploy Lambda with canary traffic shifting | [codedeploy](references/codedeploy.md) |

## Troubleshooting

| Error/Symptom | Cause | Fix |
|---------------|-------|-----|
| `YAML_FILE_ERROR` in CodeBuild | Missing or malformed `runtime-versions` in buildspec (recommended for standard images) | Add `runtime-versions` block in install phase |
| `file already exists` on CodeDeploy | Redeployment without overwrite config | Set `file_exists_behavior: OVERWRITE` |
| Pipeline trigger not firing | File path filter checks only first 100 files in diff | Reduce path filter scope or merge smaller |
| PARALLEL mode wrong revision | Race between event and source action | Use QUEUED mode for sequential consistency |
| Docker: `Cannot connect to daemon` | Missing privileged mode | Set `privilegedMode: true` AND start dockerd in buildspec |
| `CODEBUILD_CLONE_REF` permission error | CodeBuild role missing UseConnection | Add `codeconnections:UseConnection` to CodeBuild service role |
| Deployment never completes | MinimumHealthyHosts too high for instance count | Ensure healthy threshold < total instances |
| ECS deployment stuck | Health check failing on new task set | Verify target group health check path/port |

## Security

- MUST store secrets in Secrets Manager or Parameter Store; reference via CodeBuild `type: SECRETS_MANAGER` — MUST NOT embed in buildspec as PLAINTEXT
- MUST use customer-managed KMS keys for cross-account artifact encryption (default encryption does not support cross-account)
- SHOULD scope CodeBuild/CodeDeploy service roles to specific resource ARNs; MUST NOT use `*` for `s3:GetObject` or `kms:Decrypt`
- MUST use CodeConnections (not personal access tokens) for source connections; OAuth tokens cannot be rotated automatically
- See [CodePipeline security best practices](https://docs.aws.amazon.com/codepipeline/latest/userguide/security-best-practices.html) for comprehensive guidance

## Not Covered

| Topic | Use instead |
|-------|-------------|
| CDK Pipelines (`aws-cdk-lib/pipelines`) | `aws-cdk` |
| `sam deploy` / SAM CLI | `aws-serverless` |
| ECS service deployment config (circuit breaker, rolling params) | `aws-containers` |
| GitHub Actions / GitLab CI | Third-party tools, not covered |

© aws · Apache-2.0 · aws/agent-toolkit-for-aws

Similar skills

Everything for DevOps and infrastructure →

From the same set133

signing-in-to-aws Walks the agent through signing in to AWS from your local shell: version check, aws login once you confirm, then an identity check on the result. CX Codex +1 6,100installs connecting-vpcs-with-peering Sets up VPC peering connections between two VPCs for private network connectivity. It checks for CIDR overlap, updates route tables, and configures DNS resolution. CX Codex +1 6,100installs enabling-lambda-vpc-internet-access A skill that walks the agent through NAT Gateway, route tables and security groups when a Lambda in a private subnet cannot reach the internet. CX Codex +1 6,100installs troubleshooting-efs A skill that walks the agent through Amazon EFS failures: mount errors, NFS timeouts, access denied, slow throughput. CX Codex +1 5,900installs aws-networking Routes AWS networking requests across seven services to their specialized implementation skills. It helps choose between connectivity and traffic filtering options. CX Codex +1 5,900installs aws-cleanrooms Walks your agent through AWS Clean Rooms permission failures and missing CloudWatch logs for custom ML model jobs. CX Codex +1 5,700installs aws-lambda-durable-functions Teaches coding agents to build resilient AWS Lambda functions that run up to 1 year with state persistence. Useful for long-running workflows and multi-step AI agents. CX Codex +1 5,800installs aws-lambda-microvms Builds, runs, and debugs Firecracker-isolated AWS Lambda MicroVMs with fast snapshot resume and session lifetimes up to 8 hours. CX Codex +1 5,600installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor