> For the complete documentation index, see [llms.txt](https://docs.pagerly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagerly.io/sre-ai-agent/data-sources/aws.md).

# AWS

## What the Agent Can Do

* List and describe ECS services, tasks, and task definitions
* List EC2 instances and their status
* List Lambda functions and their configurations
* Query CloudWatch metrics for AWS resources
* Search CloudWatch Logs across log groups

## Setup Instructions

1. Go to **AWS Console** → **IAM** → **Roles** → **Create role**
2. Select **AWS account** → **Another AWS account**
3. Account ID: `065318983578` (Pagerly's account)
4. Check **Require external ID** → enter: `pagerly-{teamId}` (use the External ID shown in the form)
5. Click Next → attach this inline policy with permissions for ECS, Lambda, CloudWatch, etc.
6. Name the role (e.g., `PagerlySREReadRole`)
7. Copy the **Role ARN** from the role summary page

## Required Credentials

| Field                       | Description                  | Example                                             |
| --------------------------- | ---------------------------- | --------------------------------------------------- |
| **Role ARN**                | IAM role ARN for Pagerly     | `arn:aws:iam::123456789012:role/PagerlySREReadRole` |
| **AWS Region** *(optional)* | Default region for API calls | `us-east-1`                                         |

{% hint style="info" %}
**Cross-account access via IAM Role** is the most secure approach — Pagerly never stores your AWS credentials directly.
{% endhint %}

## Context Prompt Tips

> *"Our ECS cluster is prod-api in us-west-2. EC2 instances are tagged with env=production. Lambda functions start with api-."*

## Docs

* [AWS IAM Roles for Cross-Account Access](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html)
