> For the complete documentation index, see [llms.txt](https://archivedocs.stackstate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://archivedocs.stackstate.com/5.1/stackpacks/integrations/aws/aws-ecs.md).

# AWS ECS

## Overview

Get topology and telemetry information from an Amazon Elastic Container Service (ECS) cluster.

AWS ECS is a [StackState core integration](/5.1/stackpacks/integrations/about_integrations.md#stackstate-core-integrations).

## Functionality

StackState Agent V3 provides the following functionality:

* Reporting hosts, processes, and containers
* Reporting all network connections between processes / containers including network traffic telemetry
* Telemetry for hosts, processes, and containers
* Trace Agent support

## Setup

### Installation

To monitor your ECS containers and tasks run the Agent as a container on every EC2 instance in your ECS cluster.

Download the manifest from the StackState UI page **StackPacks** > **AWS ECS** and edit it providing the configuration parameters provided there.

Once the manifest is ready, the Agent task can be registered with the following command:

```
aws ecs register-task-definition --cli-input-json file://path/to/stackstate-agent-v2-ecs.json
```

The Agent should be loaded on one container on each EC2 instance. The way to achieve this is to run Agent as a [Daemon Service (docs.aws.amazon.com)](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html#service_scheduler_daemon).

Schedule a Daemon Service in AWS using StackState Agent V3 ECS Task:

1. Log in to the AWS console and navigate to the ECS Clusters section. Select the cluster you run the Agent on.
2. Create a new service by clicking the **Create** button under Services.
3. For launch type, select EC2 then the task definition created previously.
4. For service type, select `DAEMON`, and enter a Service name. Click **Next**.
5. Since the Service runs once on each instance, you won’t need a load balancer. Select None. Click **Next**.
6. Daemon services don’t need Auto Scaling, so click **Next Step** and then **Create Service**.

#### Integrate with Java traces

When used in conjunction with one of our language specific trace clients to allow automatic merging of components within StackState make sure to configure you app to use the host’s pid namespace:

```
  "containerDefinitions": [
    {
      ...
      "pidMode": "host", # ensure pid's match with processes reported by the StackState process agent
      ...
```

For example, using the [StackState Java Trace Client](/5.1/stackpacks/integrations/java-apm.md).

#### Advanced Agent configurations

The Agent can be configured to tune the process blacklist, or turn off specific features when not needed. For details, see [advanced Agent configuration](/5.1/setup/agent/advanced-agent-configuration.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://archivedocs.stackstate.com/5.1/stackpacks/integrations/aws/aws-ecs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
