Deploying to AWS CodeDeploy

1 minute read

To make it easy for you to deploy your application to AWS CodeDeploy, we’ve built a container that has the AWSCLI installed. We will set up a simple example showing you how to configure any deployment to AWS CodeDeploy.

CodeShip AWS Deployment Container

CloudBees CodeShip Pro uses an AWS deployment container that we maintain to authenticate with your AWS account.

Please review our AWS documentation to learn how to set up and use this authentication container.

You will need the AWS service, as well as your application itself, defined via your codeship-services.yml file so that you can execute the necessary S3 commands in your codeship-steps.yml file.

It is also advised that you review AWS’ IAM documentation to find the correct policies for your account.

Deploying to CodeDeploy

Deployment to Elastic Beanstalk uses a codeship_aws codedeploy_deploy command in the codeship/aws-deployment container that we’ve defined, so that you can get started quickly.

Add the following into your codeship-steps.yml file:

- service: awsdeployment command: codeship_aws codedeploy_deploy /PATH/TO/YOUR/CODE APPLICATION_NAME DEPLOYMENT_GROUP_NAME S3_BUCKET_NAME

This command will zip your application code, upload it to S3 and start a new deployment on CodeDeploy. You can take a look at the full script if you would like to review or modify it.

Note that you will need to make sure that the IAM User used with CodeShip has all necessary permissions to interact with CodeDeploy. Take a look at the getting started documentation from AWS to get the full policy template.