7 Awesome CloudFormation Hacks

Amazon CloudFormation templates are a bit tricky to write, regardless of whether you are working on your first one or you have been doing it for years. Sure, there are plenty of examples online, tools that make it easier (thanks Ansible!), and copy-pasting sections from your own library. But any tips on how to make the life easier are always welcome.

Hence, here’s a very handy collection of “7 Awesome CloudFormation Hacks“. These include:

  1. Combine two sequent intrinsic functions
  2. Use exported values from other stacks in !Sub
  3. Changes in cfn-init don’t trigger redeployment in AutoScaling Group
  4. Get Stack name of sibling stack in nested stacks
  5. AccountIds with leading zero
  6. Use Dictionaries as Stack Parameter
  7. DependsOn with condition

AWS CloudFormation Sample Templates

awslabs/aws-cloudformation-templates is an extensive collection of Amazon AWS CloudFormation templates for a wide range of resources and services. Some of these can be used as is for deploying production infrastructure, others are good starting points for those of us who are still learning.

Build load-balanced servers in AWS EC2 using CloudFormation

Build load-balanced servers in AWS EC2 using CloudFormation” is an excellent guide on deploying load balancer servers with EC2 instances to Amazon AWS cloud with CloudFormation infrastructure management tool. The guide covers a variety of topics from the actual deployment to security and monitoring.

There are many different approaches for load balancing traffic in Amazon AWS, and this one is not a holy grail solution, but it provides plenty of insight into available tools and options.

Using CloudFoundation to Build, Manage, and Deploy CloudFormation Templates

J Cole Morrison has this rather lengthy blog post on how to use CloudFoundation to simplify and automate the management of your Amazon AWS cloud infrastructure.  AWS CloudFormation is a great tool, but it gets complex real fast with larger setups, so CloudFoundation comes to the rescue.

Why Configuration Management and Provisioning are Different

In “Why Configuration Management and Provisioning are Different” Carlos Nuñez advocates for the use of specialized infrastructure provisioning tools, like Terraform, Heat, and CloudFormation, instead of relying on the configuration management tools, like Ansible or Puppet.

I agree with his argument for the rollbacks, but not so much for the maintaining state and complexity.  However I’m not yet comfortable to word my disagreement – my head is all over the place with clouds, and I’m still weak on the terminology.

The article is nice regardless, and made me look at the provisioning tools once again.