AWS CloudFormation gives developers and systems administrators an easy way to create a collection of related AWS resources and provision them in an orderly and predictable fashion. The AWS CloudFormation samples package contains a collection of templates that illustrate
various usage cases. Stacks can be created from the templates
via the AWS Management Console, through the AWS
CloudFormation command line tools or via the AWS CloudFormation APIs. You can use the templates as-is or you can use them as a starting point for creating your own templates. All the sample templates can be downloaded here.
templates from the existing AWS resources in your account. You can provision and configure your application resources the way you want using your existing processes and tools. Once everything is setup and you have the resources provisioned, simply take a "snapshot" of the configuration to create a template, enabling you to launch copies of the application with just a few clicks through the
. The CloudFormer tool is packaged as a standalone application that you can launch inside your AWS environment. The application is started on a t1.micro Amazon EC2 instance via AWS CloudFormation. No other AWS resources are required to run CloudFormer.
to launch CloudFormer.
The following sample templates show you how to provision existing open source application stack. Each of the samples shows how to deploy and install the application at launch time using the AWS CloudFormation application bootstrap support described
.
The following sample templates show you how to provision application frameworks by setting up
The following sample templates illustrate how to use different resources or template features:
| Template URL |
Description |
Launch in Asia Pacific (Sydney) Region |
| auto_scaling_with_instance_profile.template |
Create an Auto Scaling group with an an associated instance profile. |
 |
| AutoScalingKeepAtNSample.template |
An example of using Auto Scaling groups to manage a set of EC2 instances. |
 |
| AutoScalingMultiAZSample.template |
An example of using Load Balanced, Auto Scaling groups spanning multiple EC2 availability zones. This template has been updated to use Auto Scaling Policies. |
 |
| AutoScalingMultiAZWithNotifications.template |
An example of using Load Balanced Auto Scaling groups spanning multiple EC2 availability zones. This template uses Auto Scaling Policies and configures Auto Scaling notifications so that you can get emails when scaling events occur. |
 |
| bees-with-machineguns.template |
Create a load balancer, a Bees With Machine Guns Controller, and spot instances behind the load balancer; fire up bwmg and trigger attack; store logs on S3 then shutdown (if enabled). |
 |
| CloudFront_S3.template |
An example of using a CloudFront distribution with an S3 origin. |
 |
| CloudFront_MultiOrigin.template |
Example of creating and using a CloudFront Multi-Origin Distribution. |
 |
| DynamoDB_Table.template |
Example of creating and using a DynamoDB table. |
 |
| EC2WithEBSPIOPs.template |
Create an Amazon Ec2 instance and an EBS volume with Provisioned IOPs. |
 |
| ec2_instance_with_instance_profile.template |
Create an EC2 instance with an associated instance profile. |
 |
| EC2ChooseAMI.template |
An example of using Mappings to select an AMI based on region and instance type. |
 |
| EC2InstanceSample.template |
Simple EC2 instance example. |
 |
| EC2InstanceWithSecurityGroupSample.template |
Simple EC2 instance with a security group. |
 |
| EC2WebSiteSample.template |
Simple EC2-based website. |
 |
| EC2WithEBSSample.template |
Sample of attaching an EBS volume to an EC2 instance. |
 |
| EC2WithMetadata.template |
Example of using resource metadata with an EC2 instance resource. |
 |
| EC2_Untargeted_Launch_with_EBS_Volume.template |
Untargeted launch of an EC2 instance with an attached EBS volume. |
 |
| EBS_Snapshot_On_Delete.template |
Sample of attaching an EBS volume to an EC2 instance with the snapshot deletion policy. This will cause a snapshot of the EBS volume to be taken prior to the EBS volume resource being deleted. |
 |
| EIP_With_Association.template |
Associate an EC2 Instance with a pre-existing EIP. |
 |
| Elastic-Beanstalk-in-VPC.template |
Launch an AWS Elastic Beanstalk sample application in a VPC. The template creates a VPC and launches an Elastic Beanstalk application in it. |
 |
| ElasticBeanstalk_Ruby_Sample.template |
Launch an AWS Elastic Beanstalk Ruby sample application. |
 |
| ElasticBeanstalk_Python_Sample.template |
Launch an AWS Elastic Beanstalk Python sample application. |
 |
| ElasticBeanstalkSample.template |
Startup the AWS Elastic Beanstalk Sample Application |
 |
| ElasticBeanstalk_Simple.template |
Sample AWS Beanstalk application connected to an Amazon RDS database instance |
 |
| ElasticBeanstalk_PHP_Sample.template |
Launch an AWS Elastic Beanstalk PHP sample application. |
 |
| multi-tier-vpc.template |
Create a VPC that is configured to allow Elastic Beanstalk applications to launch into. |
 |
| ELBSample.template |
Elastic Load Balancer with a health check |
 |
| ELBStickinessSample.template |
Elastic Load Balancer example configured with cookie-based stickiness. |
 |
| ELBWithLockedDownEC2Instances.template |
Elastic Load Balancer with instances that are locked down to only receive traffic from the load balancer. |
 |
| ELBWithLockedDownAutoScaledInstances.template |
Elastic Load Balancer with and Auto Scaling group that is locked down to only receive traffic from the load balancer. |
 |
| ELBZoneApex.template |
Map an Elastic Load Balancer to a DNS Zone apex. |
 |
| IAM_Users_Groups_and_Policies.template |
Example of creating IAM users, groups and policies. |
 |
| IAM_Policies_for_S3.template | Example of using IAM policies to configure access to an S3 bucket. |  |
| IAM_Policies_SNS_Publish_To_SQS.template |
Example of using IAM policies to configure an SNS topic to publish to an SQS queue. |
 |
| Mutually_Referencing_EC2_Security_Groups.template |
Example of creating EC2 security groups that mutually reference each other. |
 |
| Parameter_Validate.template.template |
Parameter validation examples. |
 |
| RDS_PIOPS.template |
Create an RDS database with Provisioned IOPs. |
 |
| RDS_with_DBParameterGroup.template |
Create an RDS database with DBParameter group settings. |
 |
| RDS_Version.template |
Example of creating an Amazon Relational Database Service database instance with a specific MySQL version. |
 |
| RDS_MySQL_55.template |
Instantiate an RDS MySQL V5.5 database instance with best practice alarm configuration. |
 |
| RDS_Snapshot_On_Delete.template |
Example of creating an Amazon Relational Database Service database instance with the snapshot deletion policy. This will cause a snapshot of the Amazon RDS database instance to be created before the database resource is deleted. |
 |
| RDS_Oracle.template |
Instantiate an RDS Oracle database instance. |
 |
| Route53_A.template |
Example of creating an Amazon Route 53 DNS A record associated with an EC2 instance. |
 |
| Route53_CNAME.template |
Example of creating an Amazon Route 53 DNS CNAME record. |
 |
| Route53_RoundRobin.template |
Example of using Route 53 weighted round robin (WRR) DNS records. |
 |
| S3_Bucket.template |
Example of creating a publicly accessible S3 bucket. |
 |
| S3_Website_Bucket_With_Retain_On_Delete.template |
Example of creating an S3 bucket with the retain deletion policy to keep the bucket after the stack is deleted. |
 |
| S3_With_CloudFront_Distribution.template |
Example of creating a website using an S3, website-enabled bucket, distributed globally via CloudFront. |
 |
| S3_Website_With_CloudFront_Distribution.template |
Example of creating a website using an S3, website-enabled bucket, distributed globally via CloudFront. |
 |
|
S3Bucket_Auth_1.template,
S3Bucket_Auth_2.template,
S3Bucket_Lockdown_to_IAM_User.template,
S3Bucket_SourceAuth.template
|
Examples showing how to use cfn-init to download files and sources from an authenticated (non-public) location. |
|
| SNSToSQS.template |
Create an SNS topic that can send messages to two SQS queues with appropriate permissions for one IAM user to publish to the topic and another to read messages from the queues. |
 |
| SQS.template |
Example of creating an Amazon SQS queue. |
 |
| SQS_With_CloudWatch_Alarms.template |
Example of using Amazon CloudWatch alarms with Amazon SQS metrics. |
 |
| WaitObject.template |
Example of using a WaitCondition resource to block stack creation until an external event occurs. |
 |
| multi-tier-web-app-in-vpc.template |
Create a multi-tier web application in a VPC with multiple subnets. The first subnet is public and contains and internet facing load balancer, a NAT device for internet access from the private subnet and a bastion host to allow SSH access to the hosts in the private subnet. The second subnet is private and contains a Frontend fleet of EC2 instances, an internal load balancer and a Backend fleet of EC2 instances. |
 |
| vpc_single_instance_in_subnet.template |
Create a VPC, subnet, internet gateway, routing table and network ACL and add an EC2 instance running a sample PHP application with an Elastic IP address and a security group. |
 |
| vpc_multiple_subnets.template |
Create a VPC with multiple subnets. The first subnet is public and contains the load balancer, the second subnet is private and contains an EC2 instance behind the load balancer. |
 |
| VPC_Instance_With_Association.template |
Example of launching and Amazon EC2 instance in a pre-existing Amazon Virtual Private Cloud and associating it with an existing VPC-based Elastic IP Address. |
 |
| VPC_EC2_Instance_with_EIP_and_Security_Group.template |
Launch an Amazon EC2 instance and an associated Elastic IP address in an existing VPC. |
 |
| VPC_AutoScaling_and_ElasticLoadBalancer.template |
Launch an Auto Scaling Group and an associated Elastic Load Balancer in an existing VPC. |
 |
| VPC_RDS_DB_Instance.template |
Launch an Amazon RDS Database instance in an existing VPC. |
 |
| VPC_WordPress_Single_Instance_With_RDS.template |
Launch a single instance WordPress installation using an Amazon RDS database instance for storage in an existing VPC. |
 |
| worker-role.template |
Create a multi-az, Auto Scaled worker that pulls command messages from a queue and execs the command. This template uses spot instances as the workers. |
 |
AWS CloudFromation provides helper scripts to make it easy for you to bootstrap applications in the cloud. We have provided several
that describe how AWS CloudFormation
can help you to configure and/or install your application as well as how to bootstrap deployment and management tools that you may already use in your environment such as
Chef and Puppet. The following templates accompany those whitepapers:
You must reference a template in an S3 bucket in the same region in which you are creating the stack.
Each sample template is available in every AWS Region. You can use the same template files from each region from the following pages: