> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/integrations/data-sources/aws/ingest-cloudwatch-logs/manual-setup-of-the-integration.md).

# Manual Setup Of The Integration

### Setup a Firehose stream

1. Go to [Amazon Data Firehose](https://console.aws.amazon.com/firehose/).
2. Click on **Create Firehose stream**
   1. Source: `Direct PUT`
   2. Destination: `HTTP Endpoint`
   3. Create a name for your stream, for example `PUT-Groundcover-logs`
   4. Destination settings:
      1. HTTP endpoint URL: Firehose logs endpoint, fetched using [these docs](/architecture/byoc/ingestion-endpoints.md#aws-firehose)
      2. Access key: groundcover "3rd Party" type ingestion key, fetching using [these docs](/architecture/byoc/ingestion-endpoints.md#creating-an-ingestion-key)
      3. Content encoding: `GZIP`
      4. Parameters:
         1. `env_name` - Specify your `Environment` name, it will show up in this environment in the application
   5. Backup settings:
      1. Choose a backup bucket, or create a new one.
3. Click **Create Firehose stream**

### Create an IAM role and policy

1. Go to[ Amazon IAM](https://console.aws.amazon.com/iam/)
2. Click on **Roles** in the side bar
3. Click on **Create Role**
   1. Select **Custom trust policy**
   2. Paste the following policy:

      ```
      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Sid": "Statement1",
            "Effect": "Allow",
            "Principal": {
              "Service": "logs.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
          }
        ]
      }
      ```
   3. Click on **Next** twice (we'll attach permissions later)
   4. Provide a name for the role
   5. Click on **Create Role**
4. Go to your newly created role
   1. In the **Permissions** section, click on **Add permissions** and then **Create inline policy**
   2. Click on **JSON** and paste the following:

      ```
      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "firehose:PutRecord",
              "firehose:PutRecordBatch"
            ],
            "Resource": "<YOUR_FIREHOSE_STREAM_ARN>"
          }
        ]
      }
      ```
   3. Click on **Next**
   4. Give the policy a name
   5. Click on **Create Policy**

### Create a subscription filter

Now that we're all set up, we can add a subscription filter to the desired log group in CloudWatch.\
\
**Using CLI**

The following is an example of how to create a subscription filter through the AWS CLI:

```sh
  aws logs put-subscription-filter \
    --log-group-name "<GROUPONAME>" \
    --filter-name "<FILTERNAME>" \
    --filter-pattern "" \
    --destination-arn "<DESTINATIONARN>" \
    --role-arn "<ROLEARN>"
```

**Using AWS Console**

1. Go to the specific log group in [CloudWatch](https://console.aws.amazon.com/cloudwatch/home) and click on the **Subscription filters** tab.
   * Click on **Create**
   * Select **Create Amazon Data Firehose subscription filter**
2. Select the Firehose delivery stream created in the previous steps, as well as the IAM role.
3. Fill **Configure log format and filters** as you need.
4. Choose a name for the subscription filter, then click **Start streaming**.


---

# 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://docs.groundcover.com/integrations/data-sources/aws/ingest-cloudwatch-logs/manual-setup-of-the-integration.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.
