This project demonstrates a basic CI/CD pipeline using AWS CodePipeline, CloudFormation, Lambda, and EC2.
- Lambda function written in Python (
lambda/) - Simple static frontend served from EC2 (
frontend/) - CloudFormation templates in
cloudformation/ - Buildspec for CodeBuild to package Lambda
- Replace
your-key-nameincloudformation/main.ymlwith your EC2 key pair. - Push this repo to GitHub.
- Create CodePipeline with:
- Source: GitHub repo (main branch)
- Build: AWS CodeBuild using
buildspec.yml - Deploy: CloudFormation to deploy stack
- Lambda code is packaged and uploaded to S3 by CodeBuild.
- EC2 instance serves simple HTML on port 80.
- IAM roles are created via CloudFormation (
roles.yml). - You need to create or provide:
- EC2 key pair
- Permissions to create IAM roles/policies
- Add API Gateway in
lambda-deploy.ymlto expose Lambda via HTTP. - Add CloudWatch alarms for monitoring.