mavi888/cdk-migrated-app-infra
In this demo you will see how to migrate an existing MERN application to serverless using AWS Lambda
CDK MERN MIGRATED APP
Infrastructure as code framework used: AWS CDK
AWS Services used: AWS Lambda, AWS Amplify, Amazon Cognito, AWS S3, Amazon CloudFront, Amazon CloudWatch
Summary of the demo
In this demo you will see how to migrate an existing MERN application to serverless using AWS Lambda
This demo is part of a video posted in FooBar Serverless channel. You can check the video to see the whole demo.
Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the AWS Pricing page for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.
Requirements
- AWS CLI already configured with Administrator permission
- AWS CDK - v2
- NodeJS 16.x installed
- CDK bootstrapped in your account
Deploy this demo
Deploy the project to the cloud:
cdk synth
cdk deploy
When asked about functions that may not have authorization defined, answer (y)es. The access to those functions will be open to anyone, so keep the app deployed only for the time you need this demo running.
To delete the app:
cdk destroy
Links related to this code
- Is lift and shift migration Lambda possible? Demo with Node-Express app
- Migrate your ReactJS app to Serverless - Lift and shift your frontend
- Amazon Cognito - Add authentication and authorization to your web apps
- Add Amazon Cognito to an existing application - NodeJS-Express and React
- Introduction to Amazon CloudFront - Add CDN to your applications
- Add AWS S3 storage and use a CDN in an existing application
- Testing serverless application locally - Demo with NodeJS, Express and React
- Building Amazon CloudWatch dashboards with AWS CDK
AWS CDK useful commands
npm run buildcompile typescript to jsnpm run watchwatch for changes and compilenpm run testperform the jest unit testscdk deploydeploy this stack to your default AWS account/regioncdk diffcompare deployed stack with current statecdk synthemits the synthesized CloudFormation template