---
isPrivate: true
title: Integration Setup for ECS Fargate
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Integrations > FAQ Integrations > Integration Setup for ECS Fargate
---

# Integration Setup for ECS Fargate

Set up integrations for [ECS Fargate](https://docs.datadoghq.com/integrations/ecs_fargate.md) with [Docker Label Annotations](https://docs.datadoghq.com/agent/docker/integrations.md?tab=dockerlabel#configuration).

## Add an integration{% #add-an-integration %}

If you already [set up the Container Agent](https://docs.datadoghq.com/integrations/ecs_fargate.md#container-agent-setup) in ECS Fargate, follow these steps to add an integration to your existing cluster.

### Update the task definition{% #update-the-task-definition %}

1. Log in to your [AWS Web Console](https://aws.amazon.com/console) and navigate to the ECS section.
1. Choose the cluster the Datadog Agent is running on.
1. Click the **Tasks** tab, then click the **Task definition** name containing the Datadog Agent Container.
1. Click the **Create new revision** button, then click the **Add container** button.
1. Enter the **Container name**, **Image**, and any additional preference settings.
1. Under **Docker labels** add the following:

| Key                           | Value                                           |
| ----------------------------- | ----------------------------------------------- |
| com.datadoghq.ad.instances    | `[{"host": "%%host%%", "port": <PORT_NUMBER>}]` |
| com.datadoghq.ad.check_names  | `["<CHECK_NAME>"]`                              |
| com.datadoghq.ad.init_configs | `[{}]`                                          |
Click the **Add** button, then click the **Create** button.
### Update the service{% #update-the-service %}

1. Within the cluster, click the **Services** tab, then click the **Service Name**.
1. Click the **Update** button.
1. For the **Task Definition**, choose the latest **Revision** from the dropdown menu.
1. Click the **Next step** button 3 times, then click the **Update Service** button.

### Verification{% #verification %}

When the updated **Task** displays a **RUNNING** status, use these pages to verify information is reporting to Datadog:

- [Live Containers](https://app.datadoghq.com/containers) to view the container.
- [Metrics Explorer](https://app.datadoghq.com/metric/explorer) to view integration metrics.

### Troubleshooting{% #troubleshooting %}

If the Datadog Agent's *Health Status* in the AWS console is *Unhealthy*, but your Datadog Agent status command displays `Agent health: PASS`, ensure you are using the correct shell options (such as `CMD-SHELL`, `timeout`, and `startPeriod`). See [`datadog-agent-cws-ecs-fargate.json`](https://docs.datadoghq.com/resources/json/datadog-agent-cws-ecs-fargate.json.md).

## Examples{% #examples %}

{% tab title="Redis - Web UI" %}
Use the following table to enter the Docker labels via the [AWS Web Console](https://aws.amazon.com/console) for a Redis container:

| Key                           | Value                                  |
| ----------------------------- | -------------------------------------- |
| com.datadoghq.ad.instances    | `[{"host": "%%host%%", "port": 6379}]` |
| com.datadoghq.ad.check_names  | `["redisdb"]`                          |
| com.datadoghq.ad.init_configs | `[{}]`                                 |

{% /tab %}

{% tab title="Redis - AWS CLI" %}
Use the following JSON under `containerDefinitions` to create a Redis container via the [AWS CLI tools](https://aws.amazon.com/cli).

```json
{
  "name": "redis",
  "image": "redis:latest",
  "essential": true,
  "dockerLabels": {
    "com.datadoghq.ad.instances": "[{\"host\": \"%%host%%\", \"port\": 6379}]",
    "com.datadoghq.ad.check_names": "[\"redisdb\"]",
    "com.datadoghq.ad.init_configs": "[{}]"
  }
}
```

{% /tab %}

## Further Reading{% #further-reading %}

- [ECS Fargate](https://docs.datadoghq.com/integrations/ecs_fargate.md)
- [Monitor AWS Fargate applications with Datadog](https://www.datadoghq.com/blog/monitor-aws-fargate/)
- [Autodiscovery](https://docs.datadoghq.com/agent/docker/integrations.md)
