| .. | ||
| main.tf | ||
| provider.tf | ||
| README.md | ||
| variables.tf | ||
Checklist for adding a new Lambda
1. Create the Lambda scaffold
-
Copy the template:
cp -r lambda/_template lambda/<lambda_name>
2. Add infrastructure prerequisites (shared stack)
-
Add a new ECR repository in:
infrastructure/terraform/shared/main.tf
-
Create a PR to deploy this to main then dev in order to deploy the shared stack
-
Verify the ECR repository exists in AWS
3. Add Docker build configuration
- Create a
Dockerfilefor the Lambda - Verify the Dockerfile path and build context
- Add a new image build job in
deploy_terraform.ymlusing_build_image.yml
4. Wire the Lambda deploy job (CI)
- Add a deploy job using
_deploy_lambda.yml - Ensure the deploy job depends on the image build job
5. Deploy
- Push changes to GitHub
- CI will:
- Build and push the Docker image
- Deploy the Lambda
- Verify everything deployed. Good things to check:
- ECR with image
- SQS
- Trigger SQS
- Cloud watch logs
5. Delete
- Delete README if you used cp -r