AWS CDK project for user authentication system using AWS Cognito and ElastiCache.
- SOPS installed locally
- AWS CLI configured with Kogo AWS account
- Node.js and pnpm
# Install dependencies
pnpm install
# Decrypt secrets and bundle CDK files
pnpm dev
# Run tests
pnpm test
# Deploy
pnpm cdk:bootstrap
pnpm cdk:deploy
- Create OpenAPI spec file in
cdk/src/docs
directory - Add the Lambda function to
cdk/lib/lambdaStack.ts
:const newHandlerLambda = new NodejsFunction(this, 'NewHandlerName', { ...nodeJsFunctionProps, entry: path.join(__dirname, '../src/lambda/handlers/newHandler.ts'), bundling, }); // Add required IAM policies newHandlerLambda.addToRolePolicy(policies.cognito.userManagement); // Add API Gateway integration const newHandlerIntegration = new apigateway.LambdaIntegration(newHandlerLambda); studentResource.addResource('new-endpoint').addMethod('POST', newHandlerIntegration);
- Deploy changes in AWS API Gateway console manually
Decrypt settings:
sops --config=./config/sops.yaml -d -i ./config/settings.staging.json
sops --config=./config/sops.yaml -d -i ./config/settings.production.json
Encrypt settings:
sops --config=./config/sops.yaml -e -i ./config/settings.staging.json
sops --config=./config/sops.yaml -e -i ./config/settings.production.json
Use conventional commits with these types:
feat # New features
fix # Bug fixes
docs # Documentation changes
style # Code style changes (formatting, etc)
refactor # Code refactoring
ci # CI/CD changes
test # Adding/updating tests
foo # Minor changes
Example:
git commit -m "feat: add registration handler"
- No local test environment available
- All testing must be done in remote environment
- New endpoints require manual API Gateway deployment