

# Integration with partner products and services
<a name="integrations-partners"></a>

CodeDeploy has built-in integration for the following partner products and services:


|  |  | 
| --- |--- |
| Ansible |  If you already have a set of [Ansible](http://www.ansible.com) playbooks, but just need somewhere to run them, the template for Ansible and CodeDeploy demonstrates how a couple of simple deployment hooks can ensure Ansible is available on the local deployment instance and runs the playbooks. If you already have a process for building and maintaining your inventory, there's also an Ansible module you can use to install and run the CodeDeploy agent. Learn more: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| Atlassian – Bamboo and Bitbucket |  The CodeDeploy task for [Bamboo](https://www.atlassian.com/software/bamboo/) compresses the directory that contains an AppSpec file into a .zip file, uploads the file to Amazon S3, and then starts the deployment according to the configuration provided in the CodeDeploy application.  Atlassian Bitbucket support for CodeDeploy enables you to push code to Amazon EC2 instances directly from the Bitbucket UI, on demand, to any of your deployment groups. This means that after you update code in your Bitbucket repository, you do not have to sign in to your continuous integration (CI) platform or Amazon EC2 instances to run a manual deployment process.  Learn more: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| Chef |  AWS provides two template samples for integrating [Chef](https://www.chef.io/) and CodeDeploy. The first is a Chef cookbook that installs and starts the CodeDeploy agent. This allows you to continue managing your host infrastructure with Chef while using CodeDeploy. The second sample template demonstrates how to use CodeDeploy to orchestrate the running of cookbooks and recipes with chef-solo on each node. Learn more: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| CircleCI |  [CircleCI](https://circleci.com/) provides an automated testing and continuous integration and deployment toolset. After you create an IAM role in AWS to use with CircleCI and configure your deployment parameters in your circle.yml file, you can use CircleCI with CodeDeploy to create application revisions, upload them to an Amazon S3 bucket, and then initiate and monitor your deployments. Learn more: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| CloudBees |  You can use the CodeDeploy Jenkins plugin, available on [CloudBees](https://www.cloudbees.com/) DEV@cloud, as a post-build action. For example, at the end of a continuous delivery pipeline, you can use it to deploy an application revision to your fleet of servers. Learn more: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| Codeship |  You can use [Codeship](https://codeship.com/) to deploy application revisions through CodeDeploy. You can use the Codeship UI to add CodeDeploy to a deployment pipeline for a branch. Learn more:  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| GitHub |  You can use CodeDeploy to deploy application revisions from [GitHub](http://www.github.com) repositories. You can also trigger a deployment from a GitHub repository whenever the source code in that repository is changed. Learn more: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
|  **HashiCorp Consul**  |  You can use the open-source HashiCorp Consul tool to help ensure the health and stability of your application environment when you deploy applications in CodeDeploy. You can use Consul to register applications to be discovered during deployment, put applications and nodes in maintenance mode to omit them from deployments, and stop deployments if target instances become unhealthy. Learn more: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| Jenkins |  The CodeDeploy [Jenkins](http://jenkins-ci.org/) plugin provides a post-build step for your Jenkins project. Upon a successful build, it zips the workspace, uploads to Amazon S3, and starts a new deployment. Learn more:  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| Puppet Labs |  AWS provides sample templates for [Puppet](https://puppetlabs.com/) and CodeDeploy. The first is a Puppet module that installs and starts the CodeDeploy agent. This allows you to continue managing your host infrastructure with Puppet while using CodeDeploy. The second sample template demonstrates how to use CodeDeploy to orchestrate the running of modules and manifests with a masterless puppet on each node. Learn more:  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| SaltStack |  You can integrate [SaltStack](https://saltproject.io/index.html) infrastructure with CodeDeploy. You can use the CodeDeploy module to install and run the CodeDeploy agent on your minions or, with a couple of simple deployment hooks, you can use CodeDeploy to orchestrate the running of your Salt States. Learn more:  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
|  **TeamCity**  |  You can use the CodeDeploy Runner plugin to deploy applications directly from TeamCity. The plugin adds a TeamCity build step that prepares and uploads an application revision to an Amazon S3 bucket, registers the revision in a CodeDeploy application, creates a CodeDeploy deployment and, if you choose, waits for the deployment to be completed. Learn more: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 
| Travis CI |  You can configure [Travis CI](https://travis-ci.com/) to trigger a deployment in CodeDeploy after a successful build. Learn more:  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-partners.html)  | 

**Topics**
+ [GitHub](integrations-partners-github.md)

# Integrating CodeDeploy with GitHub
<a name="integrations-partners-github"></a>

CodeDeploy supports [GitHub](https://github.com/about), a web-based code hosting and sharing service. CodeDeploy can deploy application revisions stored in GitHub repositories or Amazon S3 buckets to instances. CodeDeploy supports GitHub for EC2/On-Premises deployments only.

**Topics**
+ [Deploying CodeDeploy revisions from GitHub](#github-deployment-steps)
+ [GitHub behaviors with CodeDeploy](#github-behaviors)

## Deploying CodeDeploy revisions from GitHub
<a name="github-deployment-steps"></a>

To deploy an application revision from a GitHub repository to instances:

1. Create a revision that's compatible with CodeDeploy and the Amazon EC2 instance type to which you will deploy.

   To create a compatible revision, follow the instructions in [Plan a revision for CodeDeploy](application-revisions-plan.md) and [Add an application specification file to a revision for CodeDeploy](application-revisions-appspec-file.md). 

1. Use a GitHub account to add your revision to a GitHub repository.

   To create a GitHub account, see [Join GitHub](https://github.com/join). To create a GitHub repository, see [Create a repo](https://help.github.com/articles/create-a-repo/).

1. Use the **Create deployment** page in the CodeDeploy console or the AWS CLI **create-deployment** command to deploy your revision from your GitHub repository to target instances configured for use in CodeDeploy deployments.

   If you want to call the **create-deployment** command, you must first use the **Create deployment** page of the console to give CodeDeploy permission to interact with GitHub on behalf of your preferred GitHub account for the specified application. You only need to do this once per application.

   To learn how to use the **Create deployment** page to deploy from a GitHub repository, see [Create a deployment with CodeDeploy](deployments-create.md).

   To learn how to call the **create-deployment** command to deploy from a GitHub repository, see [Create an EC2/On-Premises Compute Platform deployment (CLI)](deployments-create-cli.md).

   To learn how to prepare instances for use in CodeDeploy deployments, see [Working with instances for CodeDeploy](instances.md).

For more information, see [Tutorial: Use CodeDeploy to deploy an application from GitHub](tutorials-github.md).

## GitHub behaviors with CodeDeploy
<a name="github-behaviors"></a>

**Topics**
+ [GitHub authentication with applications in CodeDeploy](#behaviors-authentication)
+ [CodeDeploy interaction with private and public GitHub repositories](#behaviors-interactions-private-and-public)
+ [CodeDeploy interaction with organization-managed GitHub repositories](#behaviors-interactions-organization-managed)
+ [Automatically deploy from CodePipeline with CodeDeploy](#behaviors-deploy-automatically)

### GitHub authentication with applications in CodeDeploy
<a name="behaviors-authentication"></a>

After you give CodeDeploy permission to interact with GitHub, the association between that GitHub account and application is stored in CodeDeploy. You can link the application to a different GitHub account. You can also revoke permission for CodeDeploy to interact with GitHub.

**To link a GitHub account to an application in CodeDeploy**

1. Sign in to the AWS Management Console and open the CodeDeploy console at [https://console.aws.amazon.com/codedeploy](https://console.aws.amazon.com/codedeploy).
**Note**  
Sign in with the same user that you set up in [Getting started with CodeDeploy](getting-started-codedeploy.md).

1. In the navigation pane, expand **Deploy**, then choose **Applications**.

1. Choose the application you want to link to a different GitHub account.

1. If your application does not have a deployment group, choose **Create deployment group** to create one. For more information, see [Create a deployment group with CodeDeploy](deployment-groups-create.md). A deployment group is required to choose **Create deployment** in the next step.

1.  From **Deployments**, choose **Create deployment**. 
**Note**  
You don't have to create a new deployment. This is currently the only way to link a different GitHub account to an application.

1.  In **Deployment settings**, for **Revision type**, choose **My application is stored in GitHub**. 

1. Do one of the following:
   + To create a connection for AWS CodeDeploy applications to a GitHub account, sign out of GitHub in a separate web browser tab. In **GitHub token name**, type a name to identify this connection, and then choose **Connect to GitHub**. The web page prompts you to authorize CodeDeploy to interact with GitHub for your application. Continue to step 10.
   + To use a connection you have already created, in **GitHub token name**, select its name, and then choose **Connect to GitHub**. Continue to step 8.
   + To create a connection to a different GitHub account, sign out of GitHub in a separate web browser tab. In **GitHub token name**, type a name to identify the connection, and then choose **Connect to GitHub**. The web page prompts you to authorize CodeDeploy to interact with GitHub for your application. Continue to step 10.

1. If you are not already signed in to GitHub, follow the instructions on the **Sign in** page to sign in with the GitHub account to which you want to link the application.

1. Choose **Authorize application**. GitHub gives CodeDeploy permission to interact with GitHub on behalf of the signed-in GitHub account for the selected application. 

1. If you do not want to create a deployment, choose **Cancel**.

**To revoke permission for CodeDeploy to interact with GitHub**

1. Sign in to [GitHub ](https://github.com/dashboard) using credentials for the GitHub account in which you want to revoke AWS CodeDeploy permission.

1. Open the GitHub [Applications](https://github.com/settings/applications) page, locate **CodeDeploy** in the list of authorized applications, and then follow the GitHub procedure for revoking authorization for an application.

### CodeDeploy interaction with private and public GitHub repositories
<a name="behaviors-interactions-private-and-public"></a>

CodeDeploy supports the deployment of applications from private and public GitHub repositories. When you give CodeDeploy permission to access GitHub on your behalf, CodeDeploy will have read-write access to all of the private GitHub repositories to which your GitHub account has access. However, CodeDeploy only reads from GitHub repositories. It will not write to any of your private GitHub repositories.

### CodeDeploy interaction with organization-managed GitHub repositories
<a name="behaviors-interactions-organization-managed"></a>

By default, GitHub repositories that are managed by an organization (as opposed to your account's own private or public repositories) do not grant access to third-party applications, including CodeDeploy. Your deployment will fail if an organization's third-party application restrictions are enabled in GitHub and you attempt to deploy code from its GitHub repository. There are two ways to resolve this issue. 
+ As an organization member, you can ask the organization owner to approve access to CodeDeploy. The steps for requesting this access depend on whether you have already authorized CodeDeploy for your individual account:
  + If you have authorized access to CodeDeploy in your account, see [Requesting organization approval for your authorized applications](https://help.github.com/articles/requesting-organization-approval-for-your-authorized-applications/).
  + If you have not yet authorized access to CodeDeploy in your account, see [Requesting organization approval for third-party applications](https://help.github.com/articles/requesting-organization-approval-for-third-party-applications/).
+ The organization owner can disable all third-party application restrictions for the organization. For information, see [Disabling third-party application restrictions for your organization](https://help.github.com/articles/disabling-third-party-application-restrictions-for-your-organization/).

For more information, see [About third-party application restrictions](https://help.github.com/articles/about-third-party-application-restrictions/).

### Automatically deploy from CodePipeline with CodeDeploy
<a name="behaviors-deploy-automatically"></a>

You can trigger a deployment from a CodePipeline whenever the source code changes. For more infomation, see [CodePipeline](https://aws.amazon.com/codepipeline/).