Step 4: Increase the number of Amazon EC2 instances in the Auto Scaling group (original) (raw)
To scale out the number of Amazon EC2 instances in the Auto Scaling group (CLI)To scale out the number of Amazon EC2 instances in the deployment group (console)
In this step, you instruct the Auto Scaling group to create an additional Amazon EC2 instance. After Amazon EC2 Auto Scaling creates the instance, CodeDeploy deploys your revision to it.
Topics
- To scale out the number of Amazon EC2 instances in the Auto Scaling group (CLI)
- To scale out the number of Amazon EC2 instances in the deployment group (console)
To scale out the number of Amazon EC2 instances in the Auto Scaling group (CLI)
- Call the update-auto-scaling-group command to increase the Amazon EC2 instances in the Auto Scaling group named
CodeDeployDemo-AS-Group
from one to two.
On local Linux, macOS, or Unix machines:
aws autoscaling update-auto-scaling-group \
--auto-scaling-group-name CodeDeployDemo-AS-Group \
--min-size 2 \
--max-size 2 \
--desired-capacity 2
On local Windows machines:
aws autoscaling update-auto-scaling-group --auto-scaling-group-name CodeDeployDemo-AS-Group --min-size 2 --max-size 2 --desired-capacity 2
- Make sure the Auto Scaling group now has two Amazon EC2 instances. Call thedescribe-auto-scaling-groups command against
CodeDeployDemo-AS-Group
:
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names CodeDeployDemo-AS-Group --query "AutoScalingGroups[0].Instances[*].[HealthStatus, LifecycleState]" --output text
Do not proceed until both of the returned values show Healthy
and InService
.
To scale out the number of Amazon EC2 instances in the deployment group (console)
- In the Amazon EC2 navigation bar, under Auto Scaling, chooseAuto Scaling Groups, and then choose
CodeDeployDemo-AS-Group
. - Choose Actions, and then chooseEdit.
- On the Details tab, in theDesired, Min, andMax boxes, type
2
, and then choose Save. - Choose the Instances tab. The new Amazon EC2 instance should appear in the list. (If the instance does not appear, you may need to choose the Refresh button a few times.) Do not proceed until the value of InService appears in theLifecycle column and the value ofHealthy appears in the Health Status column.
Step 3: Check your results
Step 5: Check your results again
Did this page help you? - Yes
Thanks for letting us know we're doing a good job!
If you've got a moment, please tell us what we did right so we can do more of it.
Did this page help you? - No
Thanks for letting us know this page needs work. We're sorry we let you down.
If you've got a moment, please tell us how we can make the documentation better.