Step 5: Check your results again - Amazon CodeDeploy
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Step 5: Check your results again

In this step, you'll check to see if CodeDeploy installed the SimpleDemoApp revision on the new instance in the Auto Scaling group.

To check automatic deployment results (CLI)

  1. Before you call the get-deployment command, you will need the ID of the automatic deployment. To get the ID, call the list-deployments command against the application named SimpleDemoApp and the deployment group named SimpleDemoDG:

    aws deploy list-deployments --application-name SimpleDemoApp --deployment-group-name SimpleDemoDG --query "deployments" --output text

    There should be two deployment IDs. Use the one you have not yet used in a call to the get-deployment command:

    aws deploy get-deployment --deployment-id deployment-id --query "deploymentInfo.[status, creator]" --output text

    In addition to the deployment status, you should see autoScaling in the command output. (autoScaling means Amazon EC2 Auto Scaling created the deployment.)

    Do not proceed until the deployment status shows Succeeded.

  2. Before you call the describe-instances command, you will need the ID of the new Amazon EC2 instance. To get this ID, make another call to the describe-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[*].InstanceId" --output text

    Now make a call to the describe-instances command:

    aws ec2 describe-instances --instance-id instance-id --query "Reservations[0].Instances[0].PublicDnsName" --output text

    In the output of the describe-instances command, note the public DNS for the new Amazon EC2 instance.

  3. Using a web browser, show the SimpleDemoApp revision deployed to that Amazon EC2 instance, using a URL like the following:

    http://ec2-01-234-567-890.compute-1.amazonaws.com

    If the congratulations page appears, you've used CodeDeploy to deploy a revision to a scaled-up Amazon EC2 instance in an Auto Scaling group!

To check automatic deployment results (console)

  1. Sign in to the Amazon Web Services Management Console and open the CodeDeploy console at https://console.amazonaws.cn/codedeploy.

    Note

    Sign in with the same user that you set up in Getting started with CodeDeploy.

  2. In the navigation pane, expand Deploy, and then choose Deployments.

  3. Choose the deployment ID of the deployment that Amazon EC2 Auto Scaling created.

    .

  4. The Deployment page displays information about the deployment. Normally, you would create a deployment on your own, but Amazon EC2 Auto Scaling created one on your behalf to deploy your revision to the new Amazon EC2 instance.

  5. After Succeeded is displayed at the top of the page, verify the results on the instance. You first need to get the public DNS of the instance:

  6. In the Amazon EC2 navigation pane, under Auto Scaling, choose Auto Scaling Groups, and then choose the CodeDeployDemo-AS-Group entry.

  7. On the Instances tab, choose the ID of the new Amazon EC2 instance.

  8. On the Instances page, on the Description tab, note the Public DNS value. It should look something like this: ec2-01-234-567-890.compute-1.amazonaws.com.

Show the SimpleDemoApp revision deployed to the instance using a URL like the following:

http://ec2-01-234-567-890.compute-1.amazonaws.com

If the congratulations page appears, you've used CodeDeploy to deploy a revision to a scaled-up Amazon EC2 instance in an Auto Scaling group!