AWS CloudFormation solves the complexity of creating collections of AWS Services and Resources (RDS, EC2, etc). We can use existing Templates or create our own. From chosen Template we can easily deploy our Stack, without worries about dependency resolution of ours Services. Read more on Amazon Blog: Create Your AWS Stack From a Recipe.
CloudFormation comes for free and is fully integrated into AWS Management Console. Unfortunately you have to sing up even if you already have active AWS Account. In my case it takes few seconds and I’ve have response in my inbox.
Amazon provides article how to setup step by step WordPress blog: AWS CloudFormation in the AWS Management Console. Today this resources are supported:
- Auto Scaling Groups
- AWS Elastic Beanstalk
- CloudWatch Alarms
- EBS Volumes
- EC2 Instances
- EC2 Security Groups
- Elastic IP Addresses
- Elastic Load Balancers
- RDS Database Instances
- RDS Security Groups
- SimpleDB Domains
- SNS Topics
- SNS Subscriptions
- SQS Queues
We can easily start with CloudFormation by choosing template from this list and than customize it. Template is text resource in JSON format which describes our resources and from template we can create our stack. Today list of templates:
- WordPress (blog)
- TextPattern (content management)
- MoinMoin (wiki)
- Tracks (project tracking)
- Gollum (wiki used by GitHub)
- Drupal (content management)
- ReviewBoard (code review tool)
- Movable Type Open Source (blog)
- MantisBT (bug tracker)
- Hibari (collaboration, wiki)
- Joomla (content management)
- Insoshi (social apps)
- Redmine (project mgmt)
We may also create our template. Every template may have this sections:
- AWSTemplateFormatVersion (required): 2010-09-09
- Description (optional): We can provide comments about our template.
- Parameters (optional): We can define parameter of String or CommaSeparatedList type with default value. This values may be changed during stack creation.
- Mappings (optional): We can specify conditional parameter values. This is very similar to dictionary. To get value we use Fn::FindInMap function.
- Resources (required): Here we define resources we need with resource parameters.
- Outputs (optional): We can define information passed back to template user.
Additionally we have pseudo parameters and functions:
- AWS::Region parameter returns AWS Region in which the resource is created.
- AWS::StackName parameter returns name of the stack
- Fn::Base64 function returns Base64 encoding of input string.
- Fn::FindInMap function returns the value of a key from a mapping declared in the Mappings.
- Fn::GetAtt function returns the value of an attribute from a resource.
- Fn::GetAZs function returns comma-separated list of Availability Zones for the specified region.
- Fn::Join function appends a set of values into a single value, separated by the specified delimiter.
- Ref function allow us to use the logical name of any resource or parameter.
See WordPress template example for easy start.
Amazon is lider in public cloud computing. By introducing AWS CloudFormation Amazon makes entry into cloud computing easier. The cost is also important and AWS CloudFormation comes for free, we are only paying for Resources we are using. There is limit to 20 stacks we may create, but it seams reasonable and of course we may contact with Amazon to rise this limit. Amazon also provide detailed documentation: API Reference, Getting Started Guide, User Guide and a bonus Command Line Quick Reference Card.
All that make start with cloud computing is piece of cake!