> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/logs/integrations/providers/aws-cloudwatch.md).

# AWS CloudWatch Logs

Connect AWS CloudWatch Logs to Logs — coming soon; the card is in Cloud, but Norbix refuses to save it yet.

Amazon CloudWatch Logs is the log service of AWS: log groups and streams you can search, query with Logs Insights and turn into alarms.

{% hint style="warning" %}
Cloud has no working AWS CloudWatch Logs integration yet. The **AWS CloudWatch Logs** card is in the picker and its form opens, but the form has only **Integration Name**, and **Save** is refused: *The 'AWSCloudWatch' logging provider isn't available yet. Support for it is coming soon — for now you can use Norbix Logging or Datadog for project logging.* The same answer comes from the SDK, the CLI and the API. To keep your logs today, use [Norbix Logging](/codemash/cloud/logs/integrations/providers/norbix-logging.md).
{% endhint %}

## Get your credentials

What AWS CloudWatch Logs will ask for, from its own documentation:

1. Sign in to the AWS console and open **CloudWatch → Logs → Log groups**. Create the log group the entries should go to, for example `/norbix/bookshop-api`. See [Log groups and log streams](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html).
2. Create an IAM user or role that may write to that group (`logs:CreateLogStream`, `logs:PutLogEvents`) and an **access key** for it. See [Manage access keys for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).
3. Note the **region** of the log group, for example `eu-central-1`. Background: [CloudWatch Logs concepts](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogsConcepts.html).

## Connect it in Cloud

**Where:** Logs → Integrations → **Add New Integration** → AWS CloudWatch Logs · `/projects/<project>/logging/integrations/new/aws-cloudwatch`

| Field            | Required | What it does                                                                                | Example           |
| ---------------- | -------- | ------------------------------------------------------------------------------------------- | ----------------- |
| Integration Name | yes      | The name in your integrations list. The AWS CloudWatch Logs fields are not in the form yet. | `CloudWatch Logs` |

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-9f575654c2b292e7fd549cc1fdbc2b16a06e240a%2Faws-cloudwatch-form-1.png?alt=media" alt="New AWS CloudWatch Logs Integration form with only the field Integration Name, filled with CloudWatch Logs"><figcaption><p>The form has only the name.</p></figcaption></figure>

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-25c170bc6738bd73432acf047d25871c3ea87b95%2Faws-cloudwatch-saved-2.png?alt=media" alt="After Save: the toast Bad request and the red text The &#x27;AWSCloudWatch&#x27; logging provider isn&#x27;t available yet."><figcaption><p>Save is refused.</p></figcaption></figure>

## Test and set as default

There is nothing to test until AWS CloudWatch Logs can be saved. When it can, **Test integration** works as described in [Test an integration](/codemash/cloud/logs/integrations/test.md); logging has no default integration ([Default integration](/codemash/cloud/logs/integrations/set-default.md)).

## Common errors

| Message                                                                                                                                                      | Cause                                    | Fix                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- | ------------------------------------------------------------------------------------ |
| The 'AWSCloudWatch' logging provider isn't available yet. Support for it is coming soon — for now you can use Norbix Logging or Datadog for project logging. | Every save of AWS CloudWatch Logs today. | Use [Norbix Logging](/codemash/cloud/logs/integrations/providers/norbix-logging.md). |

## Do it from code

```ts
const { id } = await norbix.hub.logs.saveLoggingIntegration({
  projectId,
  integration: {
    provider: 'AWSCloudWatch',
    integrationName: 'CloudWatch Logs',
    isEnabled: true,
  } as any, // the TS type knows only the shared fields
});
// throws: The 'AWSCloudWatch' logging provider isn't available yet. …
```

```sh
norbix hub logs logging integration save --projectId "$NORBIX_PROJECT_ID" --integration '{"provider":"AWSCloudWatch","integrationName":"CloudWatch Logs","isEnabled":true}'
```

The provider is written `AWSCloudWatch` in requests. The client setup is on the [Logs page](/codemash/cloud/logs.md#use-it-from-code). API: [Save Logging Integration](/codemash/api-reference/logs/integrations/save-logging-integration.md)
