# AWS CloudWatch

### Add a CloudWatch source

#### 1. Open the Add Source dialog

From **Sources**, click **Add Source** and select **AWS CloudWatch**.

#### 2. Configure the source

Give the source a unique name.

By default, CloudWatch log groups are **auto-discovered** from the account. To customize, expand **Advanced config**:

* **Auto Discover** *(default)* — log groups are found automatically.
* **Log Groups** — manually specify log groups, one per line (e.g. `/aws/lambda/my-function`). Use this when you want to limit ingestion to a known set.

#### 3. Enter credentials

| Field                              | Notes                                                 |
| ---------------------------------- | ----------------------------------------------------- |
| **AWS Access Key ID**              | From an IAM user or role with CloudWatch read access. |
| **AWS Secret Access Key**          | Paired with the access key ID.                        |
| **AWS Region**                     | Region where your log groups live, e.g. `us-east-1`.  |
| **AWS Session Token** *(optional)* | Required only when using temporary STS credentials.   |

Click **Test Connection**. You should see **Connection successful**.

#### 4. Create

Click **Create** to add the source.

### After creating

The source appears in the list as **Pending** with 0 streams. Within a couple of minutes, CloudWatch events begin arriving, streams are detected, and the source transitions to **Healthy**. Each stream is listed with its inferred **Stream Type** (e.g. `ec2/stage/clickhouse`, `eks`, `unknown`).

### Assign streams to workspaces

Streams need to be assigned to a workspace to be accessible. Open the source's actions menu (gear icon) and select **Assign Streams**, then check the streams you want the **Default** workspace (or any other workspace) to receive and **Save**.

See Assigning streams to workspaces for details.

### Tips

* Add a separate CloudWatch source per AWS account or region rather than sharing credentials across environments.
* Start with **Auto Discover** for the simplest setup; move to manual **Log Groups** when you need tighter control over what's ingested.

<br>


---

# Agent Instructions: 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:

```
GET https://docs.controltheory.com/controltheory-documentation/dstl8-docs/sources/aws-cloudwatch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
