---
title: AWS CodeDeploy
description: >-
  AWS CodeDeploy is a service that automates code deployment to instances in the
  cloud and on-premise.
breadcrumbs: Docs > Integrations > AWS CodeDeploy
---

# AWS CodeDeploy



## Overview{% #overview %}

AWS CodeDeploy is a service that automates code deployment to instances in the cloud and on-premise.

Enable this integration to see AWS CodeDeploy deployment events and metrics in Datadog.

## Setup{% #setup %}

### Installation{% #installation %}

If you haven't already, set up the [Amazon Web Services integration](https://docs.datadoghq.com/integrations/amazon_web_services/) first.

### Metric collection{% #metric-collection %}

1. Add the following permissions to your [Datadog IAM policy](https://docs.datadoghq.com/integrations/amazon_web_services/#installation) in order to collect AWS CodeDeploy metrics. For more information, see the [CodeDeploy policies](https://docs.aws.amazon.com/codedeploy/latest/userguide/security-iam.html) on the AWS website.

| AWS Permission                        | Description                                                                   |
| ------------------------------------- | ----------------------------------------------------------------------------- |
| `codedeploy:ListApplications`         | Used to list all CodeDeploy applications                                      |
| `codedeploy:ListDeploymentGroups`     | Used to list all deployment groups within an application (edited)             |
| `codedeploy:ListDeployments`          | Used to list deployments in a deployment group within an application (edited) |
| `codedeploy:BatchGetDeployments`      | Gets detailed descriptions of deployments (edited)                            |
| `codedeploy:BatchGetDeploymentGroups` | Gets detailed descriptions of deployment groups                               |

1. Install the [Datadog - AWS CodeDeploy integration](https://app.datadoghq.com/integrations/amazon_codedeploy).

### Log collection{% #log-collection %}

#### Enable logging{% #enable-logging %}

Configure AWS CodeDeploy to send logs either to a S3 bucket or to CloudWatch.

**Note**: If you log to a S3 bucket, make sure that `amazon_codedeploy` is set as *Target prefix*.

#### Send logs to Datadog{% #send-logs-to-datadog %}

1. If you haven't already, set up the [Datadog Forwarder Lambda function](https://docs.datadoghq.com/logs/guide/forwarder/).

1. Once the Lambda function is installed, manually add a trigger on the S3 bucket or CloudWatch log group that contains your AWS CodeDeploy logs in the AWS console:

   - [Add a manual trigger on the S3 bucket](https://docs.datadoghq.com/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function/#collecting-logs-from-s3-buckets)
   - [Add a manual trigger on the CloudWatch Log Group](https://docs.datadoghq.com/logs/guide/send-aws-services-logs-with-the-datadog-lambda-function/#collecting-logs-from-cloudwatch-log-group)

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **aws.codedeploy.deployment**(count)           | Count of deployments.*Shown as event*                                            |
| **aws.codedeploy.deployment.run\_time**(gauge) | The run time in seconds from deployment creation to completion.*Shown as second* |

Each of the metrics retrieved from AWS is assigned the same tags that appear in the AWS console, including but not limited to host name, security-groups, and more.

### Events{% #events %}

The AWS CodeDeploy integration includes events for successful, failed, and stopped deployments. See example events below:



### Service Checks{% #service-checks %}

The AWS CodeDeploy integration does not include any service checks.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
