Here at Cloudar we write a lot of CloudFormation to provision AWS resources. We really like the way CloudFormation creates resources in parallel and how it provides an easy way to clean up all created resources.
However writing CloudFormation can be a bit of a pain. Even though AWS made this a lot easier with YAML support, for big templates we still use Troposphere. Troposphere is a python package that provides a simple (one-on-one) mapping to CloudFormation. It has some advantages like offline error checking, but its greatest assets is that it can be used in combination with a real programming language.
Having python available to write templates, leads to writing helper functions to simplify some verbose constructs and bundle commonly used resources. Today we’re happy to publish this as on open source package.
Here is an example of how it can simplify CloudFormation code:
This is the normal way to add Option Settings to an ElasticBeanstalk configuration in Troposphere:
config_template = template.add_resource(ConfigurationTemplate(
Using our helper function this can be reduced to:
config_template = t.add_resource(ConfigurationTemplate(
And this is only one of the different functions in there (and we expect to keep adding to this over time).
Do you have any helper functions you’ve written? Let us know!