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

Deployment Prerequisites

Make sure the following steps are complete before you start a deployment.

Deployment Prerequisites on an AWS Lambda Compute Platform

Deployment Prerequisites on an EC2/On-Premises Compute Platform

  • For an in-place deployment, create or configure the instances you want to deploy to. For information, see Working with Instances for AWS CodeDeploy. For a blue/green deployment, you either have an existing Auto Scaling group to use as a template for your replacement environment, or you have one or more instances or Auto Scaling groups that you specify as your original environment. For more information, see Tutorial: Use AWS CodeDeploy to Deploy an Application to an Auto Scaling Group and Integrating AWS CodeDeploy with Auto Scaling.

  • Create an application that includes at least one deployment group. For information, see Create an Application with AWS CodeDeploy and Create a Deployment Group with AWS CodeDeploy.

  • Prepare the application revision that you want to deploy to the instances in your deployment group. For information, see Working with Application Revisions for AWS CodeDeploy.

  • If you want to use a custom deployment configuration for your deployment, create it before starting the deployment process. For information, see Create a Deployment Configuration.

  • If you are deploying your application revision from an Amazon S3 bucket, the bucket is in the same AWS region as the instances in your deployment group.

  • If you are deploying your application revision from an Amazon S3 bucket, an Amazon S3 bucket policy has been applied to the bucket. This policy grants your instances the permissions required to download the application revision.

    For example, the following Amazon S3 bucket policy allows any Amazon EC2 instance with an attached IAM instance profile containing the ARN arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo to download from anywhere in the Amazon S3 bucket named codedeploydemobucket:

    Copy
    { "Statement": [ { "Action": [ "s3:Get*", "s3:List*" ], "Effect": "Allow", "Resource": "arn:aws:s3:::codedeploydemobucket/*", "Principal": { "AWS": [ "arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo" ] } } ] }

    The following Amazon S3 bucket policy allows any on-premises instance with an associated IAM user containing the ARN arn:aws:iam::80398EXAMPLE:user/CodeDeployUser to download from anywhere in the Amazon S3 bucket named codedeploydemobucket:

    Copy
    { "Statement": [ { "Action": [ "s3:Get*", "s3:List*" ], "Effect": "Allow", "Resource": "arn:aws:s3:::codedeploydemobucket/*", "Principal": { "AWS": [ "arn:aws:iam::80398EXAMPLE:user/CodeDeployUser" ] } } ] }

    To learn how to generate and attach an Amazon S3 bucket policy, see Bucket Policy Examples.

  • If you are creating a blue/green deployment, or you have specified an optional Classic Load Balancer, Application Load Balancer, or Network Load Balancer in the deployment group for an in-place deployment, you have created a VPC using Amazon VPC that contains at least two subnets. (AWS CodeDeploy uses Elastic Load Balancing, which requires all instances in a load balancer group to be in a single VPC.)

    If you have not created a VPC yet, see the Amazon VPC Getting Started Guide.

  • If you are creating a blue/green deployment, you have configured a Classic Load Balancer, Application Load Balancer, or Network Load Balancer in Elastic Load Balancing and used it to register the instances that make up your original environment.

    Note

    The instances in your replacement environment will be registered with the load balancer later.

    To configure a Classic Load Balancer, complete the steps in Tutorial: Create a Classic Load Balancer in User Guide for Classic Load Balancers. As you do, make note of the following:

    • In Step 2: Define Load Balancer, in Create LB Inside, choose the same VPC you selected when you created your instances.

    • In Step 5: Register EC2 Instances with Your Load Balancer, select the instances in your original environment.

    • In Step 7: Create and Verify Your Load Balancer, make a note of the DNS address of your load balancer.

      For example, if you named your load balancer my-load-balancer, your DNS address would appear in a format such as my-load-balancer-1234567890.us-east-2.elb.amazonaws.com.

      When you paste the DNS name into the address field of an Internet-connected web browser, you should see the application you have deployed for your original environment.

    To configure an Application Load Balancer, follow the instructions in one of the following topics:

    To configure a Network Load Balancer, follow the instructions in one of the following topics: