

# Create Auto Scaling groups with Amazon CloudFormation
<a name="creating-auto-scaling-groups-with-cloudformation"></a>

Amazon EC2 Auto Scaling is integrated with Amazon CloudFormation, a service that helps you to model and set up your Amazon resources so that you can spend less time creating and managing your resources and infrastructure. You create a template that describes all the Amazon resources that you want (such as Auto Scaling groups), and Amazon CloudFormation provisions and configures those resources for you. 

When you use Amazon CloudFormation, you can reuse your template to set up your Amazon EC2 Auto Scaling resources consistently and repeatedly. Describe your resources once, and then provision the same resources over and over in multiple Amazon Web Services accounts and Regions. 

## Amazon EC2 Auto Scaling and Amazon CloudFormation templates
<a name="working-with-templates"></a>

To provision and configure resources for Amazon EC2 Auto Scaling and related services, you must understand [Amazon CloudFormation templates](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/template-guide.html). Templates are formatted text files in JSON or YAML. These templates describe the resources that you want to provision in your Amazon CloudFormation stacks. If you're unfamiliar with JSON or YAML, you can use Amazon CloudFormation Designer to help you get started with Amazon CloudFormation templates. For more information, see [What is Amazon CloudFormation Designer?](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/working-with-templates-cfn-designer.html) in the *Amazon CloudFormation User Guide*.

To get started creating your own stack templates for Amazon EC2 Auto Scaling, complete the following tasks:
+ Create a launch template using [AWS::EC2::LaunchTemplate](https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html). 
+ Create an Auto Scaling group using [AWS::AutoScaling::AutoScalingGroup](https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html). 

For a walkthrough that shows you how to deploy an Auto Scaling group behind an Application Load Balancer, see [Walkthrough: Create a scaled and load-balanced application](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/walkthrough-autoscaling.html) in the *Amazon CloudFormation User Guide*.

You can find additional useful examples of template snippets that create Auto Scaling groups and related resources in the following sections of the *Amazon CloudFormation User Guide*:
+ [Amazon EC2 Auto Scaling resource type reference](https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/AWS_AutoScaling.html)
+ [Configure Amazon EC2 Auto Scaling resources with Amazon CloudFormation](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html)

## Learn more about Amazon CloudFormation
<a name="learn-more-cloudformation"></a>

To learn more about Amazon CloudFormation, see the following resources:
+ [Amazon CloudFormation](https://www.amazonaws.cn/cloudformation/)
+ [Amazon CloudFormation User Guide](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/Welcome.html)
+ [Amazon CloudFormation API Reference](https://docs.amazonaws.cn/AWSCloudFormation/latest/APIReference/Welcome.html)
+ [Amazon CloudFormation Command Line Interface User Guide](https://docs.amazonaws.cn/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html)