Today, AWS CloudFormation is adding support for Amazon DynamoDB and Amazon CloudFront dynamic content. You can now describe related AWS resources such as EC2 instances, Amazon DynamoDB tables, and Amazon CloudFront distributions using CloudFormation templates. These templates can fully encapsulate the resources needed to run your application on AWS and can be version controlled alongside application source.
You can easily provision and manage Amazon DynamoDB tables using CloudFormation. For example, if your application stores session state in Amazon DynamoDB, you can create the table using the CloudFormation snippet below:
Using the CloudFormation template format, you can quickly launch multiple similar stacks and customize each using the provided parameters. Should your application require more provisioned throughput, you can simply update a running CloudFormation stack and provide different parameters.
Amazon CloudFront Dynamic Content
In a previous post, I talked about how you can now use Amazon CloudFront to distribute static, dynamic, and streaming content. Now you can provision and update Amazon CloudFront distributions using CloudFormation templates. This includes support for multiple origins and dynamic content. To get started:
- You can configure multiple origin servers for your Amazon CloudFront distributions. In the example below, I host all of my pictures in S3 and I send my dynamic content to an Elastic Load Balancer:
- You can use query string parameters to customize your pages. In the example below, I’m forwarding query string parameters to my PHP origin:
- You can configure cache behaviors for different portions of the website. Here, I’m setting a lower minTTL for my static content:
Of course, if you need to make adjustments to any of the above settings, you can simply modify the template and then update your running CloudFormation stacks. CloudFormation takes care of the rest.
As usual, CloudFormation has also expanded its list of sample templates to provide more examples on how to use Amazon DynamoDB and Amazon CloudFront dynamic content. You can also visit the AWS CloudFormation User Guide to get started.
P.S: We are looking for highly motivated software developers and product managers who want to work on AWS CloudFormation. If you are interested, send us your resume to aws-cloudformation-jobs at amazon.com.