> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traversal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CloudWatch

> Connect Amazon CloudWatch to query metrics and logs via a cross-account IAM role during investigations.

Connecting Amazon CloudWatch lets Traversal query your CloudWatch metrics and logs during investigations and correlate them with your other data.

This integration is separate from [AWS Account](https://docs.traversal.com/integrations/aws-cli.md), which provides broad AWS CLI inspection across services. Configure both when you want native CloudWatch telemetry together with wider resource and configuration context.

CloudWatch access is pull-based and read-only. Traversal assumes a role in your account through AWS STS and doesn't need long-lived access keys.

## What Traversal reads

* **Metrics**: discover metrics, query time series and statistics, and inspect CloudWatch dashboards
* **Logs**: discover log groups and streams, read and filter events, and run CloudWatch Logs Insights queries

Traversal queries only the regions configured on this integration.

## Example prompts

* `Inspect CloudWatch metrics for anomalies around the start of this incident.`
* `Search the relevant CloudWatch log groups for errors and correlate them with metric changes.`
* `Compare latency, error, and saturation metrics across the configured regions.`

## Setup

**1. Download the CloudFormation template**

In Traversal, go to **Integrations**, select CloudWatch, and download the CloudFormation template. It's pre-filled with your external ID and Traversal's AWS account ID, so it needs no parameters.

**2. Deploy the role**

Deploy the template in the AWS account whose CloudWatch data you want Traversal to read. This creates a read-only IAM role that trusts Traversal's AWS principal, with the `sts:ExternalId` condition pinned to `traversal:<your_org_id>`.

> [!NOTE]
>
> Traversal assumes this role through STS for each request. It doesn't receive or store long-lived AWS access keys.

**3. Copy the role ARN**

Once the stack finishes, copy the role ARN from its outputs.

**4. Configure in Traversal**

Back in the CloudWatch integration form, enter:

* **Role ARN**
* **Regions**: every AWS region that hosts CloudWatch metrics or log groups you want investigated

> [!NOTE]
>
> Metrics and log groups are region-scoped, so a region not listed here won't be queried.

> [!TIP]
>
> To connect additional AWS accounts, repeat these steps for each account. CloudWatch supports one integration instance per account.

## Required permissions

The CloudFormation template grants only the CloudWatch and CloudWatch Logs actions needed to discover and query telemetry. These include metric listing, data and statistics queries, dashboard reads, log group and stream discovery, event reads and filtering, and Logs Insights query operations. The policy uses `Resource: "*"` because these discovery and query APIs don't support narrower resource-level scoping. Traversal limits queries to the regions in the integration configuration.

## More information

* [IAM roles with external ID conditions](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)
* [AWS Account integration](https://docs.traversal.com/integrations/aws-cli.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.