CloudWatch Logs
Configure CloudWatch Logs as a Continuous Verification health source, including IAM permissions for Access Keys, Assume Role, IRSA, dynamic Role ARN, and OIDC
Use Amazon CloudWatch Logs as a health source for Continuous Verification. This topic covers prerequisites, configuration notes, and the IAM permissions required for Access Keys, cross-account Assume Role, IRSA, dynamic Role ARN, and OIDC.
What you will learn from this topic
How to apply general CloudWatch Logs configuration rules
Which IAM permissions the AWS connector needs for DescribeRegions and Logs APIs
How to configure Assume Role, IRSA, dynamic Role ARN, and OIDC authentication
Before you begin
Continuous Verification setup: Configure an AI Verify (v1) step and health sources in your Deploy stage. Go to Configure Continuous Verification to set up verification.
AWS connector: Create or select an AWS connector that can reach CloudWatch Logs. Go to AWS connector settings reference to configure credentials, Assume Role, IRSA, or OIDC.
Delegate version: Use delegate version
858xxor later for CloudWatch Logs,859xxor later for dynamic Role ARN, and89800or later for OIDC.
General instructions
Use the following rules for each CloudWatch Logs Continuous Verification configuration:
Select only one AWS region.
Select multiple log groups when needed. If you enter a log group name manually, press Enter to register the value in the form.
Start from a sample query such as:
fields @log, @logStream, @message, @timestamp
IAM permissions
Describe Regions
By default, the AWS connector requires the ec2:DescribeRegions permission for validation. You can add it with the following policy. You can remove this requirement with the feature flag CDS_AWS_DESCRIBE_REGIONS_OPTIONAL. Go to DescribeRegions - Optional for details.
Logs
Harness uses these CloudWatch Logs APIs:
Describe Log Groups
Start Query
Get Query Results
The credentials in the AWS connector must allow those operations. The following sample policies show the required shape.
These permissions are enough when you configure the connector with AWS Access Keys credentials only.
Advanced permissions for Assume IAM role and IRSA
If you configure the AWS connector with either of the following options, add the permissions in this section in addition to the Logs and DescribeRegions permissions above:
Assume IAM role on delegate
IRSA (IAM Role on Service Account)
Assume IAM Role on Delegate with STS enabled
When you also enable cross-account access (STS Role), the IAM Role ARN must allow the delegate to assume it, and the delegate role must allow that AssumeRole call. The setup needs a two-way handshake with permission policies and trust policies.
Suppose IAM_Role_ARN_LOGS in Account A (where CloudWatch Logs live) must be assumed by a delegate in Account B that uses IAM_Role_ARN_DELEGATE. Confirm that IAM_Role_ARN_LOGS also has the CloudWatch Logs and DescribeRegions permissions from the earlier section.
Use a trust policy on IAM_Role_ARN_LOGS similar to the following:
Also grant IAM_Role_ARN_DELEGATE permission to assume roles. For example:
IRSA
For IRSA, annotate the correct service account. If the service account role ARN is IAM_Role_ARN_SERVICE_ACCOUNT, use a trust policy on IAM_Role_ARN_LOGS similar to the following:
Also grant IAM_Role_ARN_SERVICE_ACCOUNT permission to assume IAM_Role_ARN_LOGS. For example:
Dynamic Role ARN
Prerequisites
Feature flag
CDS_CV_CLOUDWATCH_DYNAMIC_ROLE_ARN_ENABLEDmust be enabled.Oldest supported delegate version is
859xx.
IAM permissions
Permissions match Assume IAM Role with STS for the new dynamic role ARN (for example, Dynamic_Role_ARN_1). The dynamic role ARN must allow the delegate to assume it, and the delegate must be able to assume the dynamic role.
Permission policies
Grant the same CloudWatch Logs and DescribeRegions permissions described earlier.
Trust policies
Use a trust policy similar to Assume IAM role:
Setup
Enable the Dynamic ARN toggle, enter the dynamic role ARN in the text box that appears, then select the region and log group.

OIDC authentication
Harness supports OIDC-based AWS connectors for both CloudWatch Logs and CloudWatch Metrics health sources. With OIDC, Harness exchanges a short-lived identity token for temporary AWS credentials, so you do not need to store long-lived access keys or run a delegate with inherited IAM permissions.
Trust policy
The IAM role that the connector assumes must trust the Harness OIDC identity provider. Replace <AWS_ACCOUNT_ID> and <HARNESS_ACCOUNT_ID> with your values.
IAM permissions for OIDC
Attach the same CloudWatch permissions to the OIDC role that you use for other credential types. The following policy covers both CloudWatch Logs and CloudWatch Metrics health sources.
If you only use CloudWatch Logs, you can omit the cloudwatch:GetMetricData and cloudwatch:ListMetrics actions. If you only use CloudWatch Metrics, you can omit the logs:* actions.
Cross-account access with OIDC
To access CloudWatch data in a different AWS account, add sts:AssumeRole to the OIDC role permission policy and configure the target account role trust policy to allow the OIDC role to assume it. This pattern matches Assume IAM Role on Delegate with STS enabled, except the source role is the OIDC role rather than a delegate-bound role.
If you use a per-query role ARN override (CloudWatch Logs only), the override chains from the OIDC session credentials rather than from the delegate ambient identity. Go to Dynamic Role ARN for setup details.
Next steps
Configure Continuous Verification: Add an AI Verify (v1) step and health sources to a Deploy stage.
CloudWatch: Configure CloudWatch Metrics as a health source.
AWS connector settings reference: Configure Access Keys, Assume Role, IRSA, or OIDC for the connector.
Last updated
Was this helpful?