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

Create an Application for a Blue/Green Deployment (Console)

To use the AWS CodeDeploy console to create an application for a blue/green deployment:

Warning

Do not follow these steps if:

  • You do not have instances with the AWS CodeDeploy agent installed that you want to replace during the blue/green deployment process. To set up your instances, follow the instructions in Working with Instances, and then follow the steps in this topic.

  • You want to create an application that uses a custom deployment configuration, but you have not yet created the deployment configuration. Follow the instructions in Create a Deployment Configuration, and then follow the steps in this topic.

  • You do not have a service role that trusts AWS CodeDeploy with, at minimum, the trust and permissions described in Step 3: Create a Service Role. To create and configure a service role, follow the instructions in Step 3: Create a Service Role, and then follow the steps in this topic.

  • You have not created a Classic load balancer in Elastic Load Balancing for the registration of the instances in your replacement environment. For more information, see Set Up a Classic Load Balancer in Elastic Load Balancing for AWS CodeDeploy Deployments.

  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 you used in Getting Started.

  2. If the AWS CodeDeploy home page appears, choose Get Started Now.

  3. Choose Create application.

  4. In the Application name box, type a name for the application. (In an AWS account, an AWS CodeDeploy application name can be used only once per region. You can reuse an application name in different regions.)

  5. In the Deployment group name box, type a name that describes the deployment group.

    Note

    If you want to use the same settings used in another deployment group (including the deployment group name; tags, Auto Scaling group names, or both; and the deployment configuration), specify those settings on this page. Although this new deployment group and the existing deployment group will have the same name, AWS CodeDeploy treats them as separate deployment groups, because they are each associated with separate applications.

  6. Choose Blue/green deployment.

  7. In Environment configuration, choose the method you want to use to provide instances for your replacement environment:

    • Automatically copy Auto Scaling group: AWS CodeDeploy will create an Auto Scaling group by copying one you specify.

    • Manually provision instances: You won't specify the instances for your replacement environment until you create a deployment. You must create the instances before you start the deployment. Instead, here you will specify the instances you want to replace.

  8. Depending on your choice in step 7, do one of the following:

    • If you chose Automatically copy Auto Scaling group: In Auto Scaling group, choose the name of the Auto Scaling group you want to use as a template for the Auto Scaling group that will be created for the instances in your replacement environment. The number of currently healthy instances in the Auto Scaling group you select will be created in your replacement environment .

    • If you chose Manually provision instances: In Choose the EC2 instances or Auto Scaling groups where the current application revision is deployed, enter Amazon EC2 tag values or Auto Scaling group names to identify the instances in your original environment (that is, the instances you want to replace or that are running the current application revision).

  9. In Load balancer, choose the Classic load balancer that will be used in the registration of instances in your replacement environment during the deployment process.

    Note

    The instances in your original environment can be, but are not required to be, registered with the load balancer you choose.

  10. In Deployment settings, review the default options for rerouting traffic to the replacement environment, which deployment configuration to use for the deployment, and how instances in the original environment are handled after the deployment.

    If you want to change the settings, continue to step 11. Otherwise, skip to step 12.

  11. To change the deployment settings for the blue/green deployment, choose Edit deployment settings, update any of the following settings, and then choose Submit.

    Setting Options
    Traffic rerouting
    • Reroute traffic immediately: As soon as instances in the replacement environment are provisioned and the latest application revision is installed on them, they are registered with the load balancer automatically, causing traffic to be rerouted to them. Instances in the original environment are then deregistered.

    • I will choose whether to reroute traffic: Instances in the replacement environment are not registered with the load balancer unless you manually reroute traffic. If the wait time you specify passes without traffic being rerouted, the deployment status is changed to Stopped.

    Deployment configuration

    Choose the rate at which instances in the replacement environment are registered with the load balancer, such as one at a time or all at once.

    Note

    After traffic is successfully routed to the replacement environment, instances in the original environment are deregistered all at once no matter which deployment configuration was selected.

    For more information, see Working with Deployment Configurations.

    Original instances
    • Terminate the original instances in the deployment group: After traffic is rerouted to the replacement environment, the instances that were deregistered from the load balancer are terminated following the wait period you specify.

    • Keep the original instances in the deployment group running: After traffic is rerouted to the replacement environment, the instances that were deregistered from the load balancer are kept running.

  12. (Optional) In Advanced, configure options you want to include in the deployment, such as Amazon SNS notification triggers, Amazon CloudWatch alarms, or automatic rollbacks.

    For information about specifying advanced options in deployment groups, see Configure Advanced Options for a Deployment Group.

  13. In the Service role ARN box, choose an Amazon Resource Name (ARN) for a service role that trusts AWS CodeDeploy with, at minimum, the trust and permissions described in Step 3: Create a Service Role. To get the service role ARN, see Get the Service Role ARN (Console) .

  14. Choose Create application.

The next step is to prepare a revision to deploy to the application and deployment group. For instructions, see Working with Application Revisions.