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

The procedures in this guide support the new console design. If you choose to use the older version of the console, you will find many of the concepts and basic procedures in this guide still apply. To access help in the new console, choose the information icon.

Step 5: Create an Application and Deployment Group

In this step, you will use the AWS CodeDeploy console or the AWS CLI to create an application and deployment group to use to deploy the sample revision from your GitHub repository.

Create an application and deployment group (console)

  1. Sign in to the AWS Management Console and open the AWS CodeDeploy console at https://console.aws.amazon.com/codedeploy.

    Note

    Sign in with the same account or IAM user information that you used in Getting Started with AWS CodeDeploy.

  2. In the navigation pane, expand Deploy, and choose Applications.

  3. Choose Create application, and then select Custom application.

  4. In Application name, enter CodeDeployGitHubDemo-App.

  5. In Compute Platform, choose EC2/On-premises.

  6. Choose Create application.

  7. On the Deployment groups tab, choose Create deployment group.

  8. In Deployment group name, enter CodeDeployGitHubDemo-DepGrp.

  9. In Service role, choose the name of your AWS CodeDeploy service role.

  10. In Deployment type, choose In-place.

  11. In Environment configuration, depending on the type of instance you are using, choose Amazon EC2 instances or On-premises instances. For Key and Value, enter the instance tag key and value that was applied to your instance as part of Step 4: Provision an Instance.

  12. In Deployment configuration, choose CodeDeployDefault.AllatOnce.

  13. In Load Balancer, clear Enable load balancing.

  14. Expand Advanced.

  15. In Alarms, select Ignore alarm configuration.

  16. Choose Create deployment group, and continue to the next step.

Create an application and deployment group (CLI)

  1. Call the create-application command to create an application in AWS CodeDeploy named CodeDeployGitHubDemo-App:

    aws deploy create-application --application-name CodeDeployGitHubDemo-App
  2. Call the create-deployment-group command to create a deployment group named CodeDeployGitHubDemo-DepGrp:

    • If you're deploying to an Amazon EC2 instance, ec2-tag-key is the Amazon EC2 instance tag key that was applied to your Amazon EC2 instance as part of Step 4: Provision an Instance.

    • If you're deploying to an Amazon EC2 instance, ec2-tag-value is the Amazon EC2 instance tag value that was applied to your Amazon EC2 instance as part of Step 4: Provision an Instance.

    • If you're deploying to an on-premises instance, on-premises-tag-key is the on-premises instance tag key that was applied to your on-premises instance as part of Step 4: Provision an Instance.

    • If you're deploying to an on-premises instance, on-premises-tag-value is the on-premises instance tag value that was applied to your on-premises instance as part of Step 4: Provision an Instance.

    • service-role-arn is a service role ARN. (Follow the instructions in Get the Service Role ARN (CLI) to find the service role ARN.)

    aws deploy create-deployment-group --application-name CodeDeployGitHubDemo-App --ec2-tag-filters Key=ec2-tag-key,Type=KEY_AND_VALUE,Value=ec2-tag-value --on-premises-tag-filters Key=on-premises-tag-key,Type=KEY_AND_VALUE,Value=on-premises-tag-value --deployment-group-name CodeDeployGitHubDemo-DepGrp --service-role-arn service-role-arn

    Note

    The create-deployment-group command provides support for creating triggers that result in the sending of Amazon SNS notifications to topic subscribers about specified events in deployments and instances. The command also supports options for automatically rolling back deployments and setting up alarms to stop deployments when monitoring thresholds in Amazon CloudWatch alarms are met. Commands for these actions are not included in this tutorial.