As pulling the docker images from dockerhub got throttled, so there is a high chance whenever we want to build something , we might get into this trouble. So CFN templates takes care of that. It creates following things for building the automation:
- ECR(EC2 Container Registry)
- A CodeBuild Project with
buildpec
inside for installing various tools like below which can be adjusted via theMakefile
- Terraform
- Tfenv
- Boto3
- Configures Python3
- Golang
- Jq
- Unzip
- A
CloudWatch Crontab
entry to invoke theCodeBuild
Job at midnight - A
CloudWatch
event Rule catches theCodeBuild
status for following states:
- FAILED
- STOPPED
- SUCCEEDED
- Event Rule subscribed to a SNS Topic
- And then
AWS Chatbot
receives notifications from above SNS topic eventually send them to Configured Slack Channel.
The idea can be further refined to have a custom lambda deployed and subscribed to cloudwatch events for codebuild status updates, process the status maybe add more metadata to it and send the notification via slack or SES.
- As of now
AWS Chabot
is not supported via terraform[1] because there is no support via AWS Go SDK[2]. So this might look more cleaner interraform
. - There might be in future AWS will deliver Public Container Registry[3], till then this helps us to keep things running.