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

Deployment Prerequisites

Before you attempt a deployment, make sure you have completed the following steps.

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

  • You have created an application that includes at least one deployment group. For information, see Create an Application and Create a Deployment Group.

  • You have prepared the application revision that you want to deploy to the instances in your deployment group. For information, see Working with Application Revisions.

  • If you want to use a custom deployment configuration for your deployment, you created 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 to grant your instances the permissions needed 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, you have created a VPC using Amazon VPC that contains at least two subnets. (For the blue/green deployment process, 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 Amazon VPC Getting Started Guide.

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

    Note

    The instances in your replacement environment will be registered with the load balancer later as part of the deployment process.

    To configure a load balancer, complete the steps in Tutorial: Create a Classic Load Balancer in Classic Load Balancer Guide. 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-1.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.