This project creates a customizable VPC infrastructure using AWS CDK with TypeScript.
- Node.js (v14.x or later)
- AWS CLI v2
- AWS CDK CLI
- AWS Account and credentials
# macOS (using Homebrew)
brew install awscli
# Verify installation
aws --versionaws configure
# Enter your:
# - AWS Access Key ID
# - AWS Secret Access Key
# - Default region (e.g., ap-southeast-2)
# - Output format (json)npm install -g aws-cdk# Install dependencies
npm install
# Copy environment file
cp .env.example .envEdit the .env file with your desired configuration:
APP_NAME: Your application nameCDK_DEPLOY_REGION: AWS region for deploymentENVIRONMENT: development/staging/productionVPC_SUBNET_TYPE:PRIVATE_ISOLATEDorPRIVATE_WITH_EGRESSNAT_GATEWAYS: Number of NAT gatewaysVPC_CIDR: VPC CIDR rangeVPC_MAX_AZS: Maximum number of Availability Zones
# Bootstrap CDK (first time only)
cdk bootstrap
# Deploy the stack
cdk deployPRIVATE_ISOLATED: VPC with private subnets onlyPRIVATE_WITH_EGRESS: VPC with private subnets and NAT Gateways for internet access
npm run buildCompile TypeScript to JavaScriptnpm run watchWatch for changes and compilenpm run testRun the jest unit testscdk deployDeploy this stack to your AWS accountcdk diffCompare deployed stack with current statecdk synthEmit the synthesized CloudFormation template