smithery/aws-samples

deploy-cdk-stack

Deploy RAPID application AWS infrastructure using CDK, including stack deployment, database migrations, and post-deployment verification.

Installation

$ npx skills add smithery/aws-samples --skill deploy-cdk-stack

Summary

  • Deploy RAPID application AWS infrastructure using CDK, including stack deployment, database migrations, and post-deployment verification.
  • Use when explicitly asked to deploy, when running CDK bootstrap for first-time setup, or when deploying after code or infrastructure changes.
  • Only execute when user says "please deploy".

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/aws-samples · top by installs.

npx skills add smithery/aws-samples

Browse all from smithery/aws-samples

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,867 B
  • docs SUMMARY.md 59 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Deploy CDK Stack

Only execute when explicitly asked to "please deploy".

Prerequisites

aws sts get-caller-identity    # AWS credentials configured
docker ps                      # Docker running
cd backend && npm ci && npm run prisma:generate && npm run build  # Backend built
cd ../cdk && npm ci            # CDK dependencies installed

Deployment Sequence

Quick Deploy (Recommended)

cd cdk
npm run deploy

Full Deployment (Manual Steps)

cd backend && npm ci && npm run prisma:generate && npm run build
cd ../cdk && npm ci
npx cdk synth                              # Validate (optional)
npx cdk deploy --require-approval never --all

First-Time Deployment

cd cdk
npx cdk bootstrap
npx cdk deploy --require-approval never --all

Parameter Customization

Edit parameter.ts

// cdk/lib/parameter.ts
export const parameters = {
  allowedIpV4AddressRanges: ["192.168.0.0/16"],
  bedrockRegion: "ap-northeast-1",
  documentProcessingModelId: "jp.anthropic.claude-sonnet-4-6",
  cognitoSelfSignUpEnabled: false,
  autoMigrate: false,
};

Command Line Parameters

npx cdk deploy -c rapid.bedrockRegion="ap-northeast-1"
npx cdk deploy -c rapid='{"bedrockRegion":"us-west-2","documentProcessingModelId":"us.anthropic.claude-sonnet-4-6"}'

Precedence: Command line > parameter.ts > parameter-schema.ts defaults

Deployment Scenarios

Scenario Commands
Code only cd backend && npm run build && cd ../cdk && npx cdk deploy --all
Infra only cd cdk && npx cdk deploy --all
Schema change Deploy + run migration command (see below)
Full stack Build all + npx cdk deploy --require-approval never --all

The default (CloudFront) mode synthesizes two stacks (RapidStack + the
us-east-1 RapidFrontendWafStack), so a bare npx cdk deploy is rejected by
the CDK CLI ("specify which stacks to use"). Always pass --all (dependency
order is resolved by the CLI).

Post-Deployment

# Get URLs
aws cloudformation describe-stacks --stack-name RapidStack \
  --query "Stacks[0].Outputs[?OutputKey=='FrontendURL'].OutputValue" --output text

aws cloudformation describe-stacks --stack-name RapidStack \
  --query "Stacks[0].Outputs[?OutputKey=='ApiEndpoint'].OutputValue" --output text

Database Migration

Manual Migration

MIGRATION_COMMAND=$(aws cloudformation describe-stacks \
  --stack-name RapidStack \
  --query "Stacks[0].Outputs[?OutputKey=='DeployMigrationCommand'].OutputValue" \
  --output text)
eval $MIGRATION_COMMAND

CDK Commands

Command Description
npx cdk synth Validate and synthesize templates
npx cdk diff Show changes vs deployed stack
npx cdk deploy --require-approval never --all Deploy without prompts
npx cdk deploy --all Deploy all stacks
npx cdk bootstrap Bootstrap CDK (first-time only)

Production Warnings

NEVER in production: Database reset, cdk destroy, prisma db push, autoMigrate: true

ALWAYS in production: Test in staging first, review changeset, backup DB before migrations, monitor CloudWatch logs.

Success Criteria

  • CloudFormation stack shows CREATECOMPLETE or UPDATECOMPLETE
  • API health endpoint responds with 200 OK
  • CloudFront URL loads application
  • CloudWatch logs show no critical errors
  • Database migration completed (if applicable)