Docs / Strand / connectors/aws-cloudwatch
AWS CloudWatch Connector
Publish custom metrics, retrieve metric data, and write log events to Amazon CloudWatch from your Strand workflows.
Prerequisites
You need AWS credentials with CloudWatch and CloudWatch Logs permissions. Here's how to set them up:
- Sign in to the AWS Management Console and navigate to IAM
- Create a new IAM user or use an existing one
- Attach a policy with the permissions listed in Required Permissions below
- Under Security credentials, create an Access key
- Copy the Access Key ID and Secret Access Key
Required Permissions
The IAM user or role must have the following permissions:
| Operation | Required IAM Permissions |
|---|---|
| Put Metric Data | cloudwatch:PutMetricData |
| Get Metric Data | cloudwatch:GetMetricStatistics |
| Put Log Events | logs:PutLogEvents, logs:CreateLogGroup, logs:CreateLogStream |
Tip: If you only need metrics or only need logs, scope the IAM policy accordingly to follow the principle of least privilege.
Connector Setup
Create an AWS CloudWatch connector from the Connectors page.
Configuration Fields
| Field | Required | Description |
|---|---|---|
| Name | Yes | Friendly name (e.g., "Production CloudWatch") |
| Authentication Type | No | api_key (default) for explicit credentials, role to use the host's IAM role / default credential chain |
| Region | Yes | AWS region for CloudWatch (e.g., us-east-1) |
| Endpoint URL | No | Custom endpoint for a self-managed target or an AWS VPC endpoint. Leave empty for AWS. |
| Access Key ID | Conditional | IAM user access key ID (encrypted at rest). Required when Authentication Type is api_key |
| Secret Access Key | Conditional | IAM user secret access key (encrypted at rest). Required when Authentication Type is api_key |
| Role ARN | Conditional | Your IAM role ARN for cross-account access via STS AssumeRole. Required when Authentication Type is role. The role must trust the Tendrl AWS account. |
| External ID | No | External ID for STS AssumeRole (encrypted). Recommended with role auth to prevent confused-deputy attacks. |
| Timeout | No | API request timeout in seconds (default: 30) |
| Description | No | Optional description for reference |
With role authentication you do not store static access keys; Strand authenticates using the host's default credential chain (EC2 instance profile, ECS task role, or environment credentials). You must still provide a Role ARN when creating the connector (the role should trust the Tendrl AWS account); an optional External ID hardens the trust policy.
Operations
Put Metric Data
Publish a custom metric data point to CloudWatch.
| Field | Required | Description |
|---|---|---|
| Namespace | Yes | CloudWatch namespace for the metric (e.g., MyApp/Orders) |
| Metric Name | Yes | Name of the metric (e.g., OrderCount) |
| Value | Yes | Numeric value for the data point (e.g., {{ payload.count }}) |
| Unit | No | Unit of the metric: Count, Seconds, Milliseconds, Bytes, Percent, None (default: None) |
Example: Publish an order count metric
- Namespace:
MyApp/Orders - Metric Name:
OrdersProcessed - Value:
{{ payload.order_count }} - Unit:
Count
Get Metric Data
Retrieve metric statistics from CloudWatch over a specified time period.
| Field | Required | Description |
|---|---|---|
| Namespace | Yes | CloudWatch namespace of the metric |
| Metric Name | Yes | Name of the metric to retrieve |
| Lookback (minutes) | No | How far back to look for data (default: 60). Ignored if Start Time is set. |
| Start Time | No | ISO 8601 start time. Overrides Lookback. |
| End Time | No | ISO 8601 end time (default: now) |
| Period | No | Granularity of data points in seconds (default: 300) |
| Statistic | No | Statistic to retrieve: Average, Sum, Minimum, Maximum, SampleCount (default: Average) |
Example: Get average CPU utilization
- Namespace:
AWS/EC2 - Metric Name:
CPUUtilization - Period:
60 - Statistic:
Average - Lookback (minutes):
120
Put Log Events
Write log messages to a CloudWatch Logs stream.
| Field | Required | Description |
|---|---|---|
| Log Group Name | Yes | Name of the log group (e.g., /myapp/production). Created automatically if it doesn't exist. |
| Log Stream Name | Yes | Name of the log stream within the group (e.g., workflow-events). Created automatically if it doesn't exist. |
| Message | Yes | Log message text |
Example: Log a workflow event
- Log Group Name:
/strand/workflows - Log Stream Name:
order-processing - Message:
[{{ payload.severity }}] Order {{ payload.order_id }} processed - status: {{ payload.status }}, duration: {{ payload.duration_ms }}ms
Output
Put Metric Data Output
{
"success": true,
"status": "sent",
"data": {
"namespace": "MyApp/Orders",
"metric_name": "OrdersProcessed",
"value": 42,
"unit": "Count"
},
"service": "aws.cloudwatch",
"operation": "put_metric_data"
}
Get Metric Data Output
{
"success": true,
"status": "completed",
"data": {
"metric_name": "CPUUtilization",
"namespace": "AWS/EC2",
"datapoints": [
{
"timestamp": "2026-02-18T14:00:00Z",
"value": 34.5,
"unit": "Percent"
},
{
"timestamp": "2026-02-18T14:05:00Z",
"value": 28.2,
"unit": "Percent"
}
],
"count": 2,
"statistic": "Average",
"period": 300
},
"service": "aws.cloudwatch",
"operation": "get_metric_data"
}
Key fields for subsequent nodes:
{{ steps.node_a1b2c3d4.output_payload.data.datapoints }}: Array of metric data points{{ steps.node_a1b2c3d4.output_payload.data.datapoints[0].value }}: Most recent data point value
Put Log Events Output
{
"success": true,
"status": "sent",
"data": {
"log_group": "/strand/workflows",
"log_stream": "order-processing"
},
"service": "aws.cloudwatch",
"operation": "put_log_events"
}
Errors
| Error | Meaning |
|---|---|
| AWS access_key_id is required | Access key ID not configured in connector. |
| AWS secret_access_key is required | Secret access key not configured in connector. |
| Namespace is required | No namespace specified for metric operations. |
| Metric name is required | No metric name specified. |
| Value is required | No numeric value provided for Put Metric Data. |
| Log group name is required | No log group specified for Put Log Events. |
| Log stream name is required | No log stream specified for Put Log Events. |
| ResourceNotFoundException | The specified log group or log stream does not exist. |
| InvalidParameterException | A parameter value is invalid (e.g., unsupported unit or stat). |
| LimitExceededException | API rate limit exceeded. Retry with backoff. |
| AccessDeniedException | The IAM user lacks the required CloudWatch or Logs permissions. |
| UnrecognizedClientException | Invalid AWS access key ID. |
| SignatureDoesNotMatch | Secret access key is incorrect. |
Example Workflow
- Create Connector with your AWS credentials and region
us-east-1(or useauth_type: "role"to leverage the host's IAM role) - Put metric data to track workflow executions:
- Namespace:
Strand/Workflows - Metric Name:
ExecutionCount - Value:
1 - Unit:
Count
- Put log events to record the workflow result:
- Log Group:
/strand/workflows - Log Stream:
execution-log - Message:
Workflow {{ payload.workflow_id }} completed with status {{ payload.status }}
- Get metric data to check recent execution trends:
- Namespace:
Strand/Workflows - Metric Name:
ExecutionCount - Period:
3600 - Stat:
Sum
Limitations
- Metric resolution: Standard resolution metrics have a minimum period of 60 seconds. High-resolution metrics (1-second period) are not currently supported.
- Log event size: Individual log events are limited to 256 KB by AWS.
- No metric dimensions: Put Metric Data publishes a single value per metric name; dimensions are not supported.
- Batch operations: Each Put Metric Data call publishes a single data point. For high-throughput metrics, consider aggregating values before publishing.
- Log group/stream creation: Put Log Events automatically creates the log group and log stream if they don't already exist (requires
logs:CreateLogGroupandlogs:CreateLogStream). - Querying logs: CloudWatch Logs Insights queries are not currently supported. Use Get Metric Data for metric retrieval.
Tendrl