Installation
Get started with sdlcs-aws-cdk-lib in your AWS CDK project.
Prerequisites
Before installing, ensure you have:
- Node.js >= 22.0.0
- npm >= 10.9.2
- AWS CDK >= 2.160.0
- AWS Account with appropriate permissions
- AWS CLI configured
Installation
Using npm
npm install sdlcs-aws-cdk-lib
Using yarn
yarn add sdlcs-aws-cdk-lib
Using pnpm
pnpm add sdlcs-aws-cdk-lib
Verify Installation
Create a simple CDK app to verify the installation:
import { App } from 'sdlcs-aws-cdk-lib';
const app = new App();
console.log('Successfully imported sdlcs-aws-cdk-lib!');
AWS Configuration
AWS Credentials
Ensure your AWS credentials are configured:
aws configure
Or use environment variables:
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
export AWS_REGION=us-east-1
CDK Bootstrap
If you haven't already, bootstrap your AWS environment for CDK:
npx cdk bootstrap aws://ACCOUNT-NUMBER/REGION
Project Structure
A typical project structure with sdlcs-aws-cdk-lib:
my-cdk-app/
├── bin/
│ └── app.ts # CDK app entry point
├── lib/
│ └── my-stack.ts # Your stack definitions
├── src/
│ └── lambda/ # Lambda function code
│ └── myFunction/
│ ├── index.ts
│ └── package.json
├── package.json
├── tsconfig.json
└── cdk.json
Next Steps
Now that you have sdlcs-aws-cdk-lib installed:
- ✅ Quick Start Guide - Build your first application
- 📖 Context Strategy - Learn about environment management
- 🚀 Blue-Green Deployments - Set up zero-downtime deployments
Troubleshooting
Node Version Issues
If you encounter Node.js version issues:
# Using nvm
nvm use 22
# Or install Node.js 22
nvm install 22
TypeScript Errors
Ensure your tsconfig.json is compatible:
{
"compilerOptions": {
"target": "ES2022",
"module": "commonjs",
"lib": ["ES2022"],
"strict": true,
"esModuleInterop": true
}
}
CDK Version Mismatch
Ensure all CDK packages are on the same version:
npm list aws-cdk-lib
npm list constructs
Update if needed:
npm update aws-cdk-lib constructs