Skip to content

Commit 88bb52f

Browse files
committed
new and updated autoscaling examples
1 parent 2d67b25 commit 88bb52f

15 files changed

+112
-113
lines changed
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
**To attach an instance to an Auto Scaling group**
22

3-
The following ``attach-instances`` command attaches an instance to an Auto Scaling group::
3+
This example attaches the specified instance to the specified Auto Scaling group::
44

55
aws autoscaling attach-instances --instance-ids i-93633f9b --auto-scaling-group-name basic-auto-scaling-group
6-
7-
For more information, see `Attach Amazon Instances to Your Auto Scaling Group`_ in the *Auto Scaling Developer Guide*.
8-
9-
.. _`Attach Amazon Instances to Your Auto Scaling Group`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/attach-instance-asg.html
10-
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**To attach a load balancer to an Auto Scaling group**
2+
3+
This example attaches the specified load balancer to the specified Auto Scaling group::
4+
5+
aws autoscaling attach-load-balancers --load-balancer-names my-lb --auto-scaling-group-name my-asg
6+
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
**To launch an Auto Scaling group**
22

3-
The following ``create-auto-scaling-group`` command launches an Auto Scaling group in a VPC::
3+
This example launches an Auto Scaling group in a VPC::
44

55
aws autoscaling create-auto-scaling-group --auto-scaling-group-name basic-auto-scaling-group --launch-configuration-name basic-launch-config --min-size 1 --max-size 3 --vpc-zone-identifier subnet-41767929c
66

7-
The following ``create-auto-scaling-group`` command launches an Auto Scaling group and configures it to use Elastic Load Balancing::
7+
This example launches an Auto Scaling group and configures it to use Elastic Load Balancing::
88

99
aws autoscaling create-auto-scaling-group --auto-scaling-group-name extended-auto-scaling-group-2 --launch-configuration-name basic-launch-config-3 --load-balancer-names "sample-lb" --health-check-type ELB --health-check-grace-period 120
1010

11-
The following ``create-auto-scaling-group`` command launches an Auto Scaling group. It specifies Availability Zones (using the ``availability-zones`` parameter) instead of subnets. It also launches any instances into a placement group and sets the termination policy to terminate the oldest instances first::
11+
This example launches an Auto Scaling group. It specifies Availability Zones (using the ``availability-zones`` parameter) instead of subnets. It also launches any instances into a placement group and sets the termination policy to terminate the oldest instances first::
1212

1313
aws autoscaling create-auto-scaling-group --auto-scaling-group-name extended-auto-scaling-group-2 --launch-configuration-name basic-launch-config-3 --min-size 1 --max-size 3 --desired-capacity 2 --default-cooldown 600 --placement-group sample-placement-group --termination-policies "OldestInstance" --availability-zones us-west-2c
1414

15-
The following ``create-auto-scaling-group`` command launches an Auto Scaling group and assigns a tag to instances in the group::
15+
This example launches an Auto Scaling group and assigns a tag to instances in the group::
1616

1717
aws autoscaling create-auto-scaling-group --auto-scaling-group-name tags-auto-scaling-group --instance-id i-22c99e2a --min-size 1 --max-size 3 --vpc-zone-identifier subnet-41767929 --tags ResourceId=tags-auto-scaling-group,ResourceType=auto-scaling-group,Key=Role,Value=WebServer
18-
19-
For more information, see `Basic Auto Scaling Configuration`_ in the *Auto Scaling Developer Guide*.
20-
21-
.. _`Basic Auto Scaling Configuration`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_BasicSetup.html
22-
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,35 @@
11
**To create a launch configuration**
22

3-
The following example uses the ``create-launch-configuration`` command to create a launch configuration::
3+
This example creates a launch configuration::
44

55
aws autoscaling create-launch-configuration --launch-configuration-name my-test-lc --image-id ami-c6169af6 --instance-type m1.medium
66

7-
The following example uses the ``create-launch-configuration`` command to create a launch configuration using Spot Instances::
7+
This example creates a launch configuration that uses Spot Instances::
88

99
aws autoscaling create-launch-configuration --launch-configuration-name my-test-lc --image-id ami-c6169af6 --instance-type m1.medium --spot-price "0.50"
1010

11-
The following example creates a launch configuration and assigns it a key pair and bootstrapping script::
11+
This example creates a launch configuration with a key pair and bootstrapping script::
1212

1313
aws autoscaling create-launch-configuration --launch-configuration-name detailed-launch-config --key-name qwikLABS-L238-20080 --image-id ami-c6169af6 --instance-type m1.small --user-data file://labuserdata.txt
1414

15-
The following example creates a launch configuration based on an existing instance. In addition, it also specifies launch configuration attributes such as a security group, tenancy, Amazon EBS optimization, and bootstrapping script::
15+
This example creates a launch configuration based on an existing instance. In addition, it also specifies launch configuration attributes such as a security group, tenancy, Amazon EBS optimization, and bootstrapping script::
1616

1717
aws autoscaling create-launch-configuration --launch-configuration-name detailed-launch-config --key-name qwikLABS-L238-20080 --instance-id i-7e13c876 --security-groups sg-eb2af88e --instance-type m1.small --user-data file://labuserdata.txt --instance-monitoring Enabled=true --no-ebs-optimized --no-associate-public-ip-address --placement-tenancy dedicated --iam-instance-profile "autoscalingrole"
1818

1919
Add the following parameter to your ``create-launch-configuration`` command to add an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100.
2020

21-
Command::
21+
Parameter::
2222

2323
--block-device-mappings "[{\"DeviceName\": \"/dev/sdh\",\"Ebs\":{\"VolumeSize\":100}}]"
2424

2525
Add the following parameter to your ``create-launch-configuration`` command to add ``ephemeral1`` as an instance store volume with the device name ``/dev/sdc``.
2626

27-
Command::
27+
Parameter::
2828

2929
--block-device-mappings "[{\"DeviceName\": \"/dev/sdc\",\"VirtualName\":\"ephemeral1\"}]"
3030

3131
Add the following parameter to your ``create-launch-configuration`` command to omit a device included on the instance (for example, ``/dev/sdf``).
3232

33-
Command::
33+
Parameter::
3434

3535
--block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"NoDevice\":\"\"}]"
36-
37-
For more information, see `Basic Auto Scaling Configuration`_ in the *Auto Scaling Developer Guide*.
38-
39-
.. _`Basic Auto Scaling Configuration`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_BasicSetup.html
40-
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
**To create or update tags for an Auto Scaling group**
22

3-
The following ``create-or-update-tags`` command attaches two tags to an Auto Scaling group::
3+
This example attaches two tags to the specified Auto Scaling group::
44

55
aws autoscaling create-or-update-tags --tags ResourceId=tags-auto-scaling-group,ResourceType=auto-scaling-group,Key=Role,Value=WebServer,PropagateAtLaunch=true ResourceId=tags-auto-scaling-group,ResourceType=auto-scaling-group,Key=Dept,Value=Research,PropagateAtLaunch=true
6-
7-
For more information, see `Add, Modify, or Remove Auto Scaling Group Tags`_ in the *Auto Scaling Developer Guide*.
8-
9-
.. _`Add, Modify, or Remove Auto Scaling Group Tags`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html
10-

awscli/examples/autoscaling/delete-launch-configuration.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
**To delete an Auto Scaling launch configuration**
1+
**To delete a launch configuration**
22

3-
The following ``delete-launch-configuration`` command deletes an Auto Scaling launch configuration::
3+
This example deletes the specified launch configuration::
44

5-
aws autoscaling delete-launch-configuration --launch-configuration-name test
5+
aws autoscaling delete-launch-configuration --launch-configuration-name my-lc
66

77
For more information, see `Shut Down Your Auto Scaling Process`_ in the *Auto Scaling Developer Guide*.
88

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
**To delete a tag from an Auto Scaling group**
22

3-
The following ``delete-tags`` command deletes a tag from an Auto Scaling group::
3+
This example deletes a tag from the specified Auto Scaling group::
44

55
aws autoscaling delete-tags --tags ResourceId=tags-auto-scaling-group,ResourceType=auto-scaling-group,Key=Dept,Value=Research
66

7-
For more information, see `Add, Modify, or Remove Auto Scaling Group Tags`_ in the *Auto Scaling Developer Guide*.
7+
For more information, see `Tagging Auto Scaling Groups and Instances`_ in the *Auto Scaling Developer Guide*.
88

9-
.. _`Add, Modify, or Remove Auto Scaling Group Tags`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html
9+
.. _`Tagging Auto Scaling Groups and Instances`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html
1010

awscli/examples/autoscaling/describe-adjustment-types.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
**To describe the Auto Scaling adjustment types**
22

3-
The following ``describe-adjustment types`` command describes the adjustment types available for Auto Scaling groups::
3+
This example describes the adjustment types available for your Auto Scaling groups::
44

55
aws autoscaling describe-adjustment-types
66

7-
The output of this command is a JSON block that describes the adjustment types, similar to the following::
7+
The following is example output::
88

9-
{
10-
"AdjustementTypes": [
11-
{
12-
"AdjustmentType": "ChangeInCapacity"
13-
}
14-
{
15-
"AdjustmentType": "ExactCapcity"
16-
}
17-
{
18-
"AdjustmentType": "PercentChangeInCapacity"
19-
}
20-
]
21-
}
9+
{
10+
"AdjustmentTypes": [
11+
{
12+
"AdjustmentType": "ChangeInCapacity"
13+
}
14+
{
15+
"AdjustmentType": "ExactCapcity"
16+
}
17+
{
18+
"AdjustmentType": "PercentChangeInCapacity"
19+
}
20+
]
21+
}
2222

2323
For more information, see `Dynamic Scaling`_ in the *Auto Scaling Developer Guide*.
2424

awscli/examples/autoscaling/describe-auto-scaling-groups.rst

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
**To get a description of an Auto Scaling group**
22

3-
The following ``describe-auto-scaling-groups`` command describes the specified Auto Scaling group::
3+
This example describes the specified Auto Scaling group::
44

5-
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name my-test-asg
5+
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name my-asg
66

7-
The output of this command is a JSON block that describes the Auto Scaling group, similar to the following::
7+
The following is example output::
88

99
{
1010
"AutoScalingGroups": [
1111
{
12-
"AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:803981987763:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-test-asg",
12+
"AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-asg",
1313
"HealthCheckGracePeriod": 0,
1414
"SuspendedProcesses": [],
1515
"DesiredCapacity": 1,
@@ -47,11 +47,6 @@ To return a specific number of Auto Scaling groups with this command, use the ``
4747

4848
aws autoscaling describe-auto-scaling-groups --max-items 1
4949

50-
This command returns a JSON block that includes a ``NextToken`` field. You can use the value of this field with the ``starting-token`` parameter to return additional Auto Scaling groups::
50+
If the output for this command includes a ``NextToken`` field, it indicates that there are more groups. You can use the value of this field with the ``starting-token`` parameter to return additional groups::
5151

5252
aws autoscaling describe-auto-scaling-groups --starting-token None___1
53-
54-
For more information, see `Basic Auto Scaling Configuration`_ in the *Auto Scaling Developer Guide*.
55-
56-
.. _`Basic Auto Scaling Configuration`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_BasicSetup.html
57-
Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,42 @@
1-
**To get a description of all the specified instances**
1+
**To describe one or more instances**
22

3-
The following ``describe-auto-scaling-instances`` command describes all the specified instances::
3+
This example describes the specified instance::
44

55
aws autoscaling describe-auto-scaling-instances --instance-ids i-4ba0837f
66

7-
The output of this command is a JSON block that describes the specified instances, similar to the following::
7+
The following is example output::
88

9-
{
10-
"AutoScalingInstances": [
11-
{
12-
"AvailabilityZone": "us-west-2c",
13-
"InstanceId": "i-4ba0837f",
14-
"AutoScalingGroupName": "my-test-asg",
15-
"HealthStatus": "HEALTHY",
16-
"LifecycleState": "InService",
17-
"LaunchConfigurationName": "my-test-lc"
18-
}
19-
]
20-
}
9+
{
10+
"AutoScalingInstances": [
11+
{
12+
"InstanceId": "i-4ba0837f",
13+
"HealthStatus": "HEALTHY",
14+
"AvailabilityZone": "us-west-2c",
15+
"AutoScalingGroupName": "my-asg",
16+
"LifecycleState": "InService"
17+
}
18+
]
19+
}
2120

22-
To return a specific number of instances with this command, use the ``max-items`` parameter::
21+
This example uses the ``max-items`` parameter to specify how many instances to return with this call::
2322

2423
aws autoscaling describe-auto-scaling-instances --max-items 1
2524

26-
This command returns a JSON block that includes a ``NextToken`` field. You can use the value of this field with the ``starting-token`` parameter to return additional Auto Scaling instances::
25+
The following is example output::
2726

28-
aws autoscaling describe-auto-scaling-instances --starting-token None___1
29-
30-
For more information, see `Basic Auto Scaling Configuration`_ in the *Auto Scaling Developer Guide*.
27+
{
28+
"NextToken": "None___1",
29+
"AutoScalingInstances": [
30+
{
31+
"InstanceId": "i-4ba0837f",
32+
"HealthStatus": "HEALTHY",
33+
"AvailabilityZone": "us-west-2c",
34+
"AutoScalingGroupName": "my-asg",
35+
"LifecycleState": "InService"
36+
}
37+
]
38+
}
3139

32-
.. _`Basic Auto Scaling Configuration`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_BasicSetup.html
40+
Notice that the output for this command includes a ``NextToken`` field, which indicates that there are more instances. You can use the value of this field with the ``starting-token`` parameter as follows to return additional instances::
3341

42+
aws autoscaling describe-auto-scaling-instances --starting-token None___1

0 commit comments

Comments
 (0)