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

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Create a Deployment Group for an EC2/On-Premises Blue/Green Deployment (Console)

To use the CodeDeploy console to create a deployment group for a blue/green deployment:

Warning

Do not follow these steps if:

  1. Sign in to the AWS Management Console and open the 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 CodeDeploy.

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

  3. On the Applications page, choose the name of the application for which you want to create a deployment group.

  4. On your application page, from the Deployment groups tab, choose Create deployment group.

  5. In Deployment group name, enter 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, Amazon EC2 Auto Scaling group names, and the deployment configuration), choose those settings on this page. Although this new deployment group and the existing deployment group have the same name, CodeDeploy treats them as separate deployment groups, because they are associated with separate applications.

  6. In Service role, choose a service role that grants CodeDeploy access to your target instance.

  7. In Deployment type choose Blue/green.

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

    1. Automatically copy Amazon EC2 Auto Scaling group: CodeDeploy creates an Amazon EC2 Auto Scaling group by copying one you specify.

    2. 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 specify the instances you want to replace.

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

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

    • If you chose Manually provision instances: Select Amazon EC2 Auto Scaling groups, Amazon EC2 Auto Scaling intances, or both to specify instances to add to this deployment group. Enter Amazon EC2 Auto Scaling tag values or Amazon EC2 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).

  10. (Optional) In Load balancer, select Enable load balancing, and then choose an existing Classic Load Balancer, Application Load Balancer, or Network Load Balancer to manage traffic to the instances during the deployment processes.

    Each instance is deregistered from the load balancer (Classic Load Balancers) or target group (Application Load Balancers and Network Load Balancers) to prevent traffic from being routed to it during the deployment. It is re-registered when the deployment is complete.

    For more information about load balancers for CodeDeploy deployments, see Integrating CodeDeploy with Elastic Load Balancing.

  11. 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 the next step. Otherwise, skip to step 13.

  12. To change the deployment settings for the blue/green deployment, choose any of the following settings.

    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 in CodeDeploy.

    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.

  13. (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.

  14. Choose Create deployment group.