Menu
AWS CodeDeploy
User Guide (API Version 2014-10-06)

Step 4: Increase the Number of Amazon EC2 Instances in the Auto Scaling Group

In this step, you'll instruct the Auto Scaling group to create an additional Amazon EC2 instance. After Auto Scaling creates the instance, AWS CodeDeploy will deploy your revision to it.

To scale up the number of Amazon EC2 instances in the Auto Scaling group (CLI)

  1. 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.

    For Linux, macOS, or Unix:

    Copy
    aws autoscaling update-auto-scaling-group \ --auto-scaling-group-name CodeDeployDemo-AS-Group \ --min-size 2 \ --max-size 2 \ --desired-capacity 2

    For Windows:

    Copy
    aws autoscaling update-auto-scaling-group --auto-scaling-group-name CodeDeployDemo-AS-Group --min-size 2 --max-size 2 --desired-capacity 2
  2. Make sure the Auto Scaling group now has two Amazon EC2 instances. Call the describe-auto-scaling-groups command against CodeDeployDemo-AS-Group:

    Copy
    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 up the number of Amazon EC2 instances in the deployment group (console)

  1. In the Amazon EC2 navigation bar, under Auto Scaling, choose Auto Scaling Groups, and then choose CodeDeployDemo-AS-Group.

  2. Choose Actions, and then choose Edit.

  3. On the Details tab, in the Desired, Min, and Max boxes, type 2, and then choose Save.

  4. 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 the Lifecycle column and the value of Healthy appears in the Health Status column.