Configure Application Auto Scaling resources using Amazon CloudFormation
Application 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, and Amazon CloudFormation provisions and configures those resources for you.
When you use Amazon CloudFormation, you can reuse your template to set up your Application 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.
Application Auto Scaling and Amazon CloudFormation templates
To provision and configure resources for Application Auto Scaling and related services, you must understand Amazon CloudFormation templates. 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? in the Amazon CloudFormation User Guide.
When you create a stack template for Application Auto Scaling resources, you must provide the following:
-
A namespace for the target service (for example,
). See the AWS::ApplicationAutoScaling::ScalableTarget reference to obtain service namespaces.appstream
-
A scalable dimension associated with the target resource (for example,
). See the AWS::ApplicationAutoScaling::ScalableTarget reference to obtain scalable dimensions.appstream:fleet:DesiredCapacity
-
A resource ID for the target resource (for example,
). See the AWS::ApplicationAutoScaling::ScalableTarget reference for information about the syntax and examples of specific resource IDs.fleet/sample-fleet
-
A service-linked role for the target resource (for example,
). See the Service-linked role ARN reference table to obtain role ARNs.arn:aws-cn:iam::012345678910:role/aws-service-role/appstream.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_AppStreamFleet
To learn more about Application Auto Scaling resources, see the Application Auto Scaling reference in the Amazon CloudFormation User Guide.
Example template snippets
You can find example snippets to include in Amazon CloudFormation templates in the following sections of the Amazon CloudFormation User Guide:
-
For examples of scaling policies and scheduled actions, see Configure Application Auto Scaling resources with Amazon CloudFormation.
-
For more examples of scaling policies, see AWS::ApplicationAutoScaling::ScalingPolicy.
Learn more about Amazon CloudFormation
To learn more about Amazon CloudFormation, see the following resources: