I recently implemented a series of AWS Batch jobs for a client. While most of these were for implementing, well, batch jobs, in the form of reporting functions, I decided to give a go to deploying Cloud Custodian using the same framework, as it basically involved creating an additional CloudFormation nested stack, building Custodian policies and baking them into a container to deploy through Batch.
Getting everything up and going was a fair bit of work, so I wanted to encapsulate my learnings into something else others could use. Despite how useful Custodian is, there aren’t many resources around showing containerized implementations (Maik Ellerbrock’s is a good one, but I had some needs that his implementation didn’t really cover), especially implementations meant to run outside of a somewhat localized context. Aside from that, there’s not a lot of good guidance for setting up all the backing resources or setting up a deployment strategy for running a containerized version in a standalone fashion. In that vein, I’ve taken a stab at getting you going with some Terraform and a (very) rudimentary container build pipeline. So, without further adieu: https://github.com/geekmuse/cloud-custodian-docker.