---
title: Amazon AWS CloudWatch
slug: connectors/amazon-aws-cloudwatch
docTags: 
createdAt: 2026-06-09T16:29:33.526Z
---

This connector allows Turbine to connect with AWS CloudWatch.

## Prerequisites

This connector authenticates with AWS CloudWatch using the following input values:

### Requirements

- AWS Access Key ID: A long-term AWS access key ID with access to IAM.
- AWS Secret Key ID: A long-term secret access key associated with the above AccessKey ID.

## Capabilities

This Connector provides the following capabilities:

- Get Log Events
- Get Query Results
- List Log Groups
- List Log Streams
- List Queries
- Start Query
- Stop Query

## Notes

For more information on AWS Identity and Access Management(IAM):

- [AWS CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/making-api-requests.html)
- [AWS CloudWatch Actions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Operations.html)

# Configurations

## AWS CloudWatch Asset

Authenticates using AWS credentials.

### Configuration Parameters

| **Parameter**       | **Description**                                                                                                                             | **Type** | **Required** |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------ |
| access\_key         | A specific long-term AWS access key ID.                                                                                                     | string   | Required     |
| secret\_key         | A specific long-term AWS secret access key.                                                                                                 | string   | Required     |
| region\_name        | The AWS Region where you want to create new connections.                                                                                    | string   | Optional     |
| role\_arn           | Role ARN                                                                                                                                    | string   | Optional     |
| session\_token      | Use if a session token is provided when switching roles.                                                                                    | string   | Optional     |
| external\_id        | External ID to assume IAM Role. Optional value used for assuming roles. Can be added, or removed in `Trusted Relationships` of target role. | string   | Optional     |
| role\_session\_name | Defaults to `SessionFromSwimlane_<HASH>` when no value is provided.                                                                         | string   | Optional     |

# Actions

## Get Log Events

The Log Group to get log events from.

### Input

| **Argument Name**    | **Type** | **Required** | **Description**                                                                                                                  |
| -------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `logGroupName`       | string   | Optional     | The name of the log group. provide either logGroupName or logGroupIdentifier not both.                                           |
| `logGroupIdentifier` | string   | Optional     | Specify either the name or ARN of the log group to view events from. provide either logGroupName or logGroupIdentifier not both. |
| `logStreamName`      | string   | Required     | The name of the log stream.                                                                                                      |
| `startTime`          | string   | Optional     | The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.                             |
| `endTime`            | string   | Optional     | The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.                               |
| `nextToken`          | string   | Optional     | The token for the next set of items to return.                                                                                   |
| `limit`              | string   | Optional     | The maximum number of log events returned.                                                                                       |
| `startFromHead`      | boolean  | Optional     | If the value is true, the earliest log events are returned first.                                                                |
| `unmask`             | boolean  | Optional     | Specify true to display the log event fields with all sensitive data unmasked and visible.                                       |

### Input Example

`{"logGroupName":"/aws/lambda/apphub-bundles","logGroupIdentifier":"xyzabc","logStreamName":"2018/12/04/[$LATEST]d53f6d4b5fe14daa80dcdaab92c5c2a5","startTime":"1562078646","endTime":"1562078646","nextToken":"123ab34c","limit":"100","startFromHead":true,"unmask":true}`

### Output

| **Parameter**          | **Type** | **Description**                 |
| ---------------------- | -------- | ------------------------------- |
| `events`               | array    | Output field: events            |
| `events.timestamp`     | number   | Output field: events.timestamp  |
| `events.message`       | string   | Response message                |
| `events.ingestionTime` | number   | Time value                      |
| `nextForwardToken`     | string   | Output field: nextForwardToken  |
| `nextBackwardToken`    | string   | Output field: nextBackwardToken |

### Output Example

`{"events":[{"timestamp":123,"message":"string","ingestionTime":123}],"nextForwardToken":"string","nextBackwardToken":"string"}`

## Get Query Results

Returns the results from the specified query.

### Input

| **Argument Name** | **Type** | **Required** | **Description**             |
| ----------------- | -------- | ------------ | --------------------------- |
| `queryId`         | string   | Required     | The ID number of the query. |

### Input Example

`{"queryId":"123ABCD"}`

### Output

| **Parameter**               | **Type** | **Description**                         |
| --------------------------- | -------- | --------------------------------------- |
| `results`                   | array    | Result of the operation                 |
| `results.0`                 | object   | Result of the operation                 |
| `results.0.field`           | string   | Result of the operation                 |
| `results.0.value`           | string   | Value for the parameter                 |
| `statistics`                | object   | Output field: statistics                |
| `statistics.recordsMatched` | number   | Output field: statistics.recordsMatched |
| `statistics.recordsScanned` | number   | Output field: statistics.recordsScanned |
| `statistics.bytesScanned`   | number   | Output field: statistics.bytesScanned   |
| `status`                    | string   | Status value                            |

### Output Example

`{"results":[[{}]],"statistics":{"recordsMatched":123,"recordsScanned":123,"bytesScanned":123},"status":"Scheduled"}`

## List Log Groups

Lists the specified log groups. You can list all your log groups or filter the results by prefix. The results are ASCII-sorted by log group name.

### Input

| **Argument Name**       | **Type** | **Required** | **Description**               |
| ----------------------- | -------- | ------------ | ----------------------------- |
| `accountIdentifiers`    | array    | Optional     | Unique identifier             |
| `logGroupNamePrefix`    | string   | Optional     | Name of the resource          |
| `logGroupNamePattern`   | string   | Optional     | Name of the resource          |
| `nextToken`             | string   | Optional     | Parameter for List Log Groups |
| `limit`                 | number   | Optional     | Parameter for List Log Groups |
| `includeLinkedAccounts` | boolean  | Optional     | Parameter for List Log Groups |

### Input Example

`{"accountIdentifiers":["string"],"logGroupNamePrefix":"string","logGroupNamePattern":"string","nextToken":"string","limit":123,"includeLinkedAccounts":true}`

### Output

| **Parameter**                    | **Type** | **Description**                         |
| -------------------------------- | -------- | --------------------------------------- |
| `logGroups`                      | array    | Output field: logGroups                 |
| `logGroups.logGroupName`         | string   | Name of the resource                    |
| `logGroups.creationTime`         | number   | Time value                              |
| `logGroups.retentionInDays`      | number   | Output field: logGroups.retentionInDays |
| `logGroups.metricFilterCount`    | number   | Count value                             |
| `logGroups.arn`                  | string   | Output field: logGroups.arn             |
| `logGroups.storedBytes`          | number   | Output field: logGroups.storedBytes     |
| `logGroups.kmsKeyId`             | string   | Unique identifier                       |
| `logGroups.dataProtectionStatus` | string   | Response data                           |
| `nextToken`                      | string   | Output field: nextToken                 |

### Output Example

`{"logGroups":[{"logGroupName":"string","creationTime":123,"retentionInDays":123,"metricFilterCount":123,"arn":"string","storedBytes":123,"kmsKeyId":"string","dataProtectionStatus":"ACTIVATED"}],"nextToken":"string"}`

## List Log Streams

Lists the log streams for the specified log group. You can list all the log streams or filter the results by prefix.

### Input

| **Argument Name**     | **Type** | **Required** | **Description**                                                                                                                                                          |
| --------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `logGroupName`        | string   | Optional     | The name of the log group.                                                                                                                                               |
| `logGroupIdentifier`  | string   | Optional     | Specify either the name or ARN of the log group to view. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN. |
| `logStreamNamePrefix` | string   | Optional     | The prefix to match.                                                                                                                                                     |
| `orderBy`             | string   | Optional     | the results are ordered by given input, example LogStreamName, LastEventTime, LogStreamName.                                                                             |
| `descending`          | boolean  | Optional     | If the value is true, results are returned in descending order.                                                                                                          |
| `nextToken`           | string   | Optional     | The token for the next set of items to return.                                                                                                                           |
| `limit`               | number   | Optional     | The maximum number of items returned. If you don’t specify a value, the default is up to 50 items.                                                                       |

### Input Example

`{"logGroupName":"/aws/lambda/apphub-bundles","logGroupIdentifier":"xyz","logStreamNamePrefix":"2018/12/04","orderBy":"LogStreamName","descending":true,"nextToken":"axwab","limit":123}`

### Output

| **Parameter**                    | **Type** | **Description**                              |
| -------------------------------- | -------- | -------------------------------------------- |
| `logStreams`                     | array    | Output field: logStreams                     |
| `logStreams.logStreamName`       | string   | Name of the resource                         |
| `logStreams.creationTime`        | number   | Time value                                   |
| `logStreams.firstEventTimestamp` | number   | Output field: logStreams.firstEventTimestamp |
| `logStreams.lastEventTimestamp`  | number   | Output field: logStreams.lastEventTimestamp  |
| `logStreams.lastIngestionTime`   | number   | Time value                                   |
| `logStreams.uploadSequenceToken` | string   | Output field: logStreams.uploadSequenceToken |
| `logStreams.arn`                 | string   | Output field: logStreams.arn                 |
| `logStreams.storedBytes`         | number   | Output field: logStreams.storedBytes         |
| `nextToken`                      | string   | Output field: nextToken                      |

### Output Example

`{"logStreams":[{"logStreamName":"string","creationTime":123,"firstEventTimestamp":123,"lastEventTimestamp":123,"lastIngestionTime":123,"uploadSequenceToken":"string","arn":"string","storedBytes":123}],"nextToken":"string"}`

## List Queries

Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account.

### Input

| **Argument Name** | **Type** | **Required** | **Description**            |
| ----------------- | -------- | ------------ | -------------------------- |
| `logGroupName`    | string   | Optional     | Name of the resource       |
| `status`          | string   | Optional     | Status value               |
| `maxResults`      | number   | Optional     | Result of the operation    |
| `nextToken`       | string   | Optional     | Parameter for List Queries |

### Input Example

`{"logGroupName":"abcd","status":"Scheduled","maxResults":123,"nextToken":"xyz"}`

### Output

| **Parameter**          | **Type** | **Description**                   |
| ---------------------- | -------- | --------------------------------- |
| `queries`              | array    | Output field: queries             |
| `queries.queryId`      | string   | Unique identifier                 |
| `queries.queryString`  | string   | Output field: queries.queryString |
| `queries.status`       | string   | Status value                      |
| `queries.createTime`   | number   | Time value                        |
| `queries.logGroupName` | string   | Name of the resource              |
| `nextToken`            | string   | Output field: nextToken           |

### Output Example

`{"queries":[{"queryId":"string","queryString":"string","status":"Scheduled","createTime":123,"logGroupName":"string"}],"nextToken":"string"}`

## Start Query

Schedules a query of a log group using CloudWatch Logs Insights. You specify the log group and time range to query and the query string to use.

### Input

| **Argument Name**     | **Type** | **Required** | **Description**                                                            |
| --------------------- | -------- | ------------ | -------------------------------------------------------------------------- |
| `logGroupName`        | string   | Optional     | The log group on which to perform the query.                               |
| `logGroupNames`       | array    | Optional     | The list of log groups to be queried. You can include up to 50 log groups. |
| `logGroupIdentifiers` | array    | Optional     | The list of log groups to query. You can include up to 50 log groups.      |
| `startTime`           | number   | Required     | The beginning of the time range to query.                                  |
| `endTime`             | number   | Required     | The end of the time range to query.                                        |
| `queryString`         | string   | Required     | The query string to use.                                                   |
| `limit`               | number   | Optional     | The maximum number of log events to return in the query.                   |

### Input Example

`{"logGroupName":"/aws/lambda/apphub-bundles","logGroupNames":["string1"],"logGroupIdentifiers":["string1"],"startTime":123,"endTime":123,"queryString":"string","limit":123}`

### Output

| **Parameter** | **Type** | **Description**   |
| ------------- | -------- | ----------------- |
| `queryId`     | string   | Unique identifier |

### Output Example

`{"queryId":"string"}`

## Stop Query

Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.

### Input

| **Argument Name** | **Type** | **Required** | **Description**                                                                  |
| ----------------- | -------- | ------------ | -------------------------------------------------------------------------------- |
| `query_id`        | string   | Required     | The ID number of the query to stop. To find this ID number, use DescribeQueries. |

### Input Example

`{"query_id":"82be43d4-c53f-4b02-9812-37bf08c5c15f"}`

### Output

| **Parameter** | **Type** | **Description**                      |
| ------------- | -------- | ------------------------------------ |
| `success`     | boolean  | Whether the operation was successful |

### Output Example

`{"success":true}`

# Response Headers

| **Header**   | **Description**                                       | **Example**                   |
| ------------ | ----------------------------------------------------- | ----------------------------- |
| Content-Type | The media type of the resource                        | application/json              |
| Date         | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |
