Claude-skill-registry aws-codepipeline

Build automated CI/CD pipelines with CodePipeline and CodeBuild

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/aws-codepipeline" ~/.claude/skills/majiayu000-claude-skill-registry-aws-codepipeline && rm -rf "$T"
manifest: skills/data/aws-codepipeline/SKILL.md
source content

AWS CodePipeline Skill

Create automated CI/CD pipelines for application deployment.

Quick Reference

AttributeValue
AWS ServiceCodePipeline, CodeBuild
ComplexityMedium
Est. Time20-45 min
PrerequisitesSource repo, IAM role, deployment target

Parameters

Required

ParameterTypeDescriptionValidation
pipeline_namestringPipeline name^[A-Za-z0-9.@_-]{1,100}$
source_providerstringSource typeGitHub, CodeCommit, S3
deployment_targetstringDeploy targetECS, Lambda, EC2, S3

Optional

ParameterTypeDefaultDescription
branchstringmainSource branch
build_imagestringaws/codebuild/standard:7.0Build environment
deploy_strategystringrollingrolling, blue_green, canary
approval_requiredboolfalseManual approval gate

Pipeline Architecture

┌──────────┐   ┌───────┐   ┌──────┐   ┌─────────────┐
│  Source  │───│ Build │───│ Test │───│  Deploy-Dev │
└──────────┘   └───────┘   └──────┘   └──────┬──────┘
                                             │
┌─────────────┐   ┌──────────┐   ┌──────────┴──────────┐
│ Deploy-Prod │◄──│ Approval │◄──│  Deploy-Staging     │
└─────────────┘   └──────────┘   └─────────────────────┘

Implementation

Create Pipeline

# Create pipeline with GitHub source
aws codepipeline create-pipeline --cli-input-json '{
  "pipeline": {
    "name": "my-app-pipeline",
    "roleArn": "arn:aws:iam::123456789012:role/CodePipelineRole",
    "stages": [
      {
        "name": "Source",
        "actions": [{
          "name": "GitHub",
          "actionTypeId": {
            "category": "Source",
            "owner": "ThirdParty",
            "provider": "GitHub",
            "version": "2"
          },
          "configuration": {
            "ConnectionArn": "arn:aws:codestar-connections:...",
            "FullRepositoryId": "org/repo",
            "BranchName": "main"
          },
          "outputArtifacts": [{"name": "SourceOutput"}]
        }]
      },
      {
        "name": "Build",
        "actions": [{
          "name": "CodeBuild",
          "actionTypeId": {
            "category": "Build",
            "owner": "AWS",
            "provider": "CodeBuild",
            "version": "1"
          },
          "inputArtifacts": [{"name": "SourceOutput"}],
          "outputArtifacts": [{"name": "BuildOutput"}],
          "configuration": {
            "ProjectName": "my-build-project"
          }
        }]
      }
    ]
  }
}'

BuildSpec Template

# buildspec.yml
version: 0.2

env:
  variables:
    NODE_ENV: production
  secrets-manager:
    DB_PASSWORD: prod/db:password

phases:
  install:
    runtime-versions:
      nodejs: 20
    commands:
      - npm ci

  pre_build:
    commands:
      - npm run lint
      - npm run test:unit

  build:
    commands:
      - npm run build
      - docker build -t $ECR_REPO:$CODEBUILD_RESOLVED_SOURCE_VERSION .

  post_build:
    commands:
      - docker push $ECR_REPO:$CODEBUILD_RESOLVED_SOURCE_VERSION
      - printf '[{"name":"app","imageUri":"%s"}]' $ECR_REPO:$CODEBUILD_RESOLVED_SOURCE_VERSION > imagedefinitions.json

artifacts:
  files:
    - imagedefinitions.json
    - appspec.yml

cache:
  paths:
    - node_modules/**/*

Deployment Strategies

StrategyRiskRollbackUse Case
RollingMediumMinutesStandard updates
Blue/GreenLowInstantZero-downtime
CanaryLowestInstantGradual validation
All-at-onceHighMinutesDev/test only

Troubleshooting

Common Issues

SymptomCauseSolution
Source failedConnection issueCheck GitHub connection
Build failedbuildspec errorCheck CodeBuild logs
Deploy failedIAM or targetCheck deployment logs
Stuck at approvalNo approverNotify approvers

Debug Checklist

  • Pipeline IAM role has permissions?
  • Source connection authorized?
  • Build environment has required tools?
  • Artifact bucket accessible?
  • Deploy target accessible?
  • AppSpec/imagedefinitions correct?

Pipeline Execution Analysis

# Get failed execution details
aws codepipeline get-pipeline-execution \
  --pipeline-name my-pipeline \
  --pipeline-execution-id abc-123

# Get action execution details
aws codepipeline list-action-executions \
  --pipeline-name my-pipeline \
  --filter 'pipelineExecutionId=abc-123'

Test Template

def test_buildspec_syntax():
    # Arrange
    buildspec_path = "buildspec.yml"

    # Act
    with open(buildspec_path) as f:
        buildspec = yaml.safe_load(f)

    # Assert
    assert buildspec['version'] == 0.2
    assert 'phases' in buildspec
    assert 'build' in buildspec['phases']

Assets

  • assets/buildspec.yml
    - CodeBuild specification template

References