Rapidly create AWS SAM microservices. GitHub template to jumpstart common work.
- Compiles NodeJS TypeScript to JS for AWS Lambda.
- Uses SAM template to create Lambda function
- Unit tests the Lambda handlers & libraries.
- Runs CI/CD pipelines through GitHub Actions.
- Monitors Lambda errors, and triggers CloudWatch Alarm.
- Grants the least privileges CI/CD security best practise; through AWS CDK unit tested.
- Delegates permissions through role CI/CD security best practise; through AWS CDK unit tested.
- Rapidly deploys dev stack locally through Makefile commands
- Automates dependency updates for NPM packages.
- Automates dependency updates for GitHub actions dependencies.
- Reuses CI checks through reusable GitHub workflows
- Ensures
workflow runs at a time through GitHub's concurrency feature.
- Use this template to create a new GitHub repository.
- Clone your repository on your local machine.
- Configure AWS CloudFormation, such as stack name, region, and others through
infrastructurerc.json
- Find & global replace
aws-sam-ts
with your service name. - Create & authorise the CI/CD user with the least privileges. These have to be generated through your local machine to avoid putting administrator IAM credentials online.
cd cicd-authorisation && make deploy
- Use the link from the output to visit the newly created IAM user.
- Create access key
- Add the access keys as GitHub encrypted repository secrets: AWS_ACCESS_KEY_ID & AWS_SECRET_ACCESS_KEY
- Once you commit & git push to main branch, it will be deployed to the default test stack
- Verify setup by deploying development CloudFormation stack:
- This is the fastest development workflow and highly recommended.
- Add an AWS profile in
~/.aws/credentials
namedcicd_{{your_service_name}}
with credentials retrieved from cicd-authorisation creation. make deploy-dev
.
- Deploy to production environment by clicking the
Run workflow
button inDeploy
action. Example - Use the exported output
MonitorActionsArn
to integrate with AWS Chatbot Slack, emails, or other integration types.