Anda di halaman 1dari 9

Auto Scaling

Getting Started Guide


API Version 2011-01-01
Auto Scaling Getting Started Guide

Auto Scaling: Getting Started Guide


Copyright 2015 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.
The following are trademarks of Amazon Web Services, Inc.: Amazon, Amazon Web Services Design, AWS, Amazon CloudFront,
AWS CloudTrail, AWS CodeDeploy, Amazon Cognito, Amazon DevPay, DynamoDB, ElastiCache, Amazon EC2, Amazon Elastic
Compute Cloud, Amazon Glacier, Amazon Kinesis, Kindle, Kindle Fire, AWS Marketplace Design, Mechanical Turk, Amazon Redshift,
Amazon Route 53, Amazon S3, Amazon VPC, and Amazon WorkDocs. In addition, Amazon.com graphics, logos, page headers,
button icons, scripts, and service names are trademarks, or trade dress of Amazon in the U.S. and/or other countries. Amazon's
trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is
likely to cause confusion among customers, or in any manner that disparages or discredits Amazon.

All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected
to, or sponsored by Amazon.
Auto Scaling Getting Started Guide

Table of Contents
Get Started with Auto Scaling .......................................................................................................... 1
Create an Auto Scaling Group ......................................................................................................... 2
Create a Launch Configuration ................................................................................................ 2
Create an Auto Scaling Group ................................................................................................. 3
Verify Auto Scaling Group Creation ........................................................................................... 3
Delete an Auto Scaling Group .......................................................................................................... 4
Where Do I Go from Here? ............................................................................................................. 5
Resources ........................................................................................................................... 5

API Version 2011-01-01


iii
Auto Scaling Getting Started Guide

Get Started with Auto Scaling

Auto Scaling is designed to launch or terminate EC2 instances automatically based on user-defined
policies, schedules, and health checks. This tutorial walks you through the process of creating an Auto
Scaling group and then deleting it.

Prerequisites

Before you start this tutorial, complete Setting Up in the Auto Scaling Developer Guide.

API Version 2011-01-01


1
Auto Scaling Getting Started Guide
Create a Launch Configuration

Create an Auto Scaling Group

Let's create a simple Auto Scaling group designed to contain exactly one EC2 instance. First, you'll create
a launch configuration that specifies the type of EC2 instance that you want Auto Scaling to create. Next,
you'll create an Auto Scaling group that references your launch configuration. Finally, you'll verify that
the Auto Scaling group is functioning.

If you haven't done so already, you must create a virtual private cloud (VPC) and a security group for
your VPC. For more information, see Setting Up in the Amazon EC2 User Guide for Linux Instances.

Create a Launch Configuration


The launch configuration specifies the type of EC2 instance that Auto Scaling creates for you. To create
a launch configuration, you must specify an Amazon Machine Image (AMI) ID and an EC2 instance type.

To create a launch configuration

1. Open the Amazon EC2 console.


2. In the navigation pane, click Launch Configurations. If you are new to Auto Scaling, you see a
welcome page; click Create Auto Scaling group.
3. Click Create launch configuration.
4. On the Choose AMI page, click Free tier only, and then select an Amazon Linux AMI with the HVM
virtualization type.
5. On the Choose Instance Type page, select the General purpose tab, select the t2.micro instance
type, and then click Next: Configure details.
6. On the Configure details page, do the following:

a. Under Create Launch Configuration, enter a name for your launch configuration (for example,
my-lc).
b. Expand Advanced Details, and then select Assign a public IP address to every instance.
c. Click Skip to review.

7. On the Review page, click Edit security groups. Click Select an existing security group, select
the security group that you created for your VPC, and then click Review.
8. On the Review page, click Create launch configuration.

API Version 2011-01-01


2
Auto Scaling Getting Started Guide
Create an Auto Scaling Group

9. In the Select an existing key pair or create a new key pair dialog box, select Choose an existing
key pair, then select an existing key pair. Click the acknowledgment check box, and then click Create
launch configuration.
Tip
If you don't plan to log in to your instance, you can select Proceed without a key pair
instead. If you'd like to log in to your instance but don't have a key pair already, follow the
directions to create one.

Create an Auto Scaling Group


After you have defined your launch configuration, you are automatically taken to the page to create an
Auto Scaling group. To create an Auto Scaling group, you must specify a name for your group, a launch
configuration, one or more Availability Zones, a minimum group size, and a maximum group size. Use
the launch configuration that you created in the previous procedure. The Availability Zones you choose
determine the physical location of your Auto Scaling instances. For this example, specify a single zone.
Set the minimum and maximum size of your Auto Scaling group to 1. Because the minimum size of the
group is 1, Auto Scaling begins creating an EC2 instance immediately.

To create an Auto Scaling group

1. On the Configure Auto Scaling group details page, do the following:

a. Enter a name for the Auto Scaling group. For example, my-asg.
b. In Group size, type 1 in the text box.
c. T2 instances must be launched into a subnet. Select your VPC from the Network list and the
public subnet from the Subnet list.
d. Click Next: Configure scaling policies.

2. On the Configure scaling policies page, click Review.


3. On the Review page, click Create Auto Scaling group.
4. Click View your Auto Scaling groups.

Verify Auto Scaling Group Creation


First, verify that your instance is ready. From the Auto Scaling Groups page, select your Auto Scaling
group, and then select the Instances tab. Initially, your instance is in the Pending state. When the state
is InService, it is ready for use.

API Version 2011-01-01


3
Auto Scaling Getting Started Guide

Delete an Auto Scaling Group

When you are finished, delete the Auto Scaling group. Deleting an Auto Scaling group using the console
terminates all EC2 instances in the Auto Scaling group. After you delete the Auto Scaling group, you can
delete the launch configuration.

To delete the Auto Scaling group

1. Open the Amazon EC2 console.


2. In the navigation pane, click Auto Scaling Groups.
3. Select your Auto Scaling group, click Actions, and then click Delete.
4. When prompted for confirmation, click Yes, Delete. The values of the Desired, Min, and Max columns
change to 0 and the EC2 instances enter the terminating state.

To delete the launch configuration

1. In the navigation pane, click Launch Configurations.


2. Select your launch configuration, click Actions, and then click Delete launch configuration.
3. When prompted for confirmation, click Yes, Delete.

API Version 2011-01-01


4
Auto Scaling Getting Started Guide
Resources

Where Do I Go from Here?

Auto Scaling offers features we haven't covered in this guide, such as setting the desired capacity, creating
scaling policies, and integrating with CloudWatch, Elastic Load Balancing, and Amazon Simple Notification
Service.You can also get more information about features like the following in the Auto Scaling Developer
Guide:

Health Checks
A health check is a call to check on the health status of each instance in an Auto Scaling group. If
an instance reports degraded performance, Auto Scaling terminates the instance and launches
another one to take its place.
Triggers
A trigger is a combination of an Auto Scaling policy and an CloudWatch alarm.You can create alarms
that monitor specific metrics gathered from an EC2 instance. When paired with an alarm, a policy
can initiate an Auto Scaling action when a CloudWatch metric breaches a specific threshold.
Scheduled Updates
A scheduled update is a call to Auto Scaling that is scheduled for a future time.
Suspending and Resuming Processes
You can suspend scaling processes at any time. When you're ready, you can resume any or all of
the suspended processes. When an Auto Scaling group's scaling processes are suspended, Auto
Scaling creates no new scaling activities for that group for any reason. Scaling activities that were
already in progress before the group was suspended continue until complete.

Resources
The following related resources can help you as you work with this service.

Auto Scaling The primary web page for information about Auto Scaling.
Auto Scaling Technical FAQ The FAQ covers questions developers have asked about Auto Scaling.
Amazon EC2 Discussion Forum Get help from the community of developers.

AWS Developer Tools Links to developer tools and resources that provide documentation, code
samples, release notes, and other information to help you build innovative applications with AWS.
AWS Support Center The hub for creating and managing your AWS Support cases. Also includes
links to other helpful resources, such as forums, technical FAQs, service health status, and AWS
Trusted Advisor.

API Version 2011-01-01


5
Auto Scaling Getting Started Guide
Resources

AWS Support The primary web page for information about AWS Support, a one-on-one, fast-response
support channel to help you build and run applications in the cloud.
Contact Us A central contact point for inquiries concerning AWS billing, account, events, abuse, and
other issues.
AWS Site Terms Detailed information about our copyright and trademark; your account, license, and
site access; and other topics.

API Version 2011-01-01


6

Anda mungkin juga menyukai