Recommended Setup - For self-hosted deployments on AWS EKS, use IAM Roles for Service Accounts (IRSA) instead of access keys for enhanced security.
Overview
Self-hosted Relvy deployments on AWS EKS can connect to AWS CloudWatch using IAM role assumption instead of static access keys. This provides several security benefits:Benefits of IRSA Authentication
- No Credential Rotation - No need to manage or rotate access keys
- Enhanced Security - Temporary credentials with automatic rotation
- Better Audit Trail - CloudTrail logs show which role assumed another role
- Least Privilege - Fine-grained permissions per AWS account
How It Works
The IRSA setup uses a two-role architecture:- IRSA Role (in Relvy deployment account) - Kubernetes service account assumes this role using OIDC
- CloudWatch Role (in customer’s AWS account) - The IRSA role assumes this role to access CloudWatch
Prerequisites
Before starting, ensure you have:- ✅ EKS Cluster - Relvy deployed on AWS EKS with OIDC provider enabled
- ✅ AWS CLI - Configured with permissions to create IAM roles
- ✅ kubectl Access - Access to your Relvy Kubernetes cluster
- ✅ Helm - For updating Relvy configuration
- ✅ OIDC Details - Your EKS cluster’s OIDC provider URL and ID
Get Your OIDC Provider Details
You’ll need your EKS OIDC provider information. Find it using:- Region:
us-east-1(from URL) - OIDC ID:
EXAMPLED539D4633E53DE1B71EXAMPLE(the hash after/id/)
Step 1: Create IRSA Role (Relvy Deployment Account)
The IRSA role runs in the same AWS account where Relvy is deployed. This role allows your Relvy pods to assume other roles.1.1 Create Trust Policy
Create a file namedirsa-trust-policy.json:
YOUR-RELVY-ACCOUNT-ID- AWS account ID where Relvy is deployedREGION- Your EKS cluster region (e.g.,us-east-1)OIDC-ID- Your OIDC provider ID from prerequisitesNAMESPACE- Kubernetes namespace where Relvy is deployed (usuallydefault)SERVICE-ACCOUNT-NAME- Kubernetes service account name (usuallyrelvy-serviceaccount)
1.2 Create Permission Policy
Create a file namedirsa-permission-policy.json:
Role Name Flexibility - The Resource field uses a wildcard (*) to allow assuming roles named RelvyCloudWatchRole in any AWS account. You can customize this name, but make sure it matches the role name you create in Step 2.
1.3 Create the IAM Role
arn:aws:iam::111122223333:role/RelvyIRSARole
Step 2: Create CloudWatch Role (Customer’s AWS Account)
For each AWS account where you want to access CloudWatch, create a CloudWatch role that trusts your IRSA role.2.1 Create Trust Policy
Create a file namedcloudwatch-trust-policy.json:
YOUR-RELVY-ACCOUNT-ID- AWS account ID where Relvy is deployed (same as Step 1)RelvyIRSARole- The IRSA role name from Step 1
2.2 Create Permission Policy
Create a file namedcloudwatch-permission-policy.json:
Scoped Permissions - For tighter security, replace Resource: "" with specific log group ARNs like “arn:aws:logs:REGION:ACCOUNT-ID:log-group:YOUR-LOG-GROUP:“
2.3 Create the IAM Role
Run these commands in the AWS account where CloudWatch data resides:arn:aws:iam::444455556666:role/RelvyCloudWatchRole
Step 3: Configure Kubernetes Service Account
Update your Relvy Helm deployment to use the IRSA role.3.1 Update Helm Values
Add or update theserviceAccount section in your Helm values file (values.yaml):
role-arn with your IRSA role ARN from Step 1.
3.2 Upgrade Helm Deployment
Apply the configuration to your cluster:3.3 Restart Deployments
Restart Relvy deployments to pick up the new service account:Step 4: Configure Relvy UI
Now configure the CloudWatch connection in the Relvy web interface.4.1 Access Data Sources Configuration
- Log in to your Relvy instance (
https://relvy.yourdomain.com) - Navigate to Settings → Data Sources
- Locate the AWS CloudWatch section
4.2 Configure Authentication
In the AWS CloudWatch configuration:- Select Authentication Method: Choose IAM Role (instead of Access Keys)
- Enter AWS Role ARN: The CloudWatch role ARN from Step 2
- Example:
arn:aws:iam::444455556666:role/RelvyCloudWatchRole
- Example:
- Enter AWS Region: The region where your CloudWatch data resides
- Example:
us-east-1
- Example:
- Click Connect
4.3 Verify Connection
After clicking Connect, you should see:- ✅ Connected status badge
- Available log groups discovered from CloudWatch
Alternative: Using Access Keys
If IRSA is not suitable for your setup, you can still use access keys:- In Relvy UI, select Authentication Method: Access Keys
- Provide AWS Access Key ID and Secret Access Key
- Enter AWS Region
- Click Connect
Next Steps
Your AWS CloudWatch integration with IRSA is now complete! Next steps:- Configure Log Groups - Select which log groups to analyze in Relvy settings
- Set Up Dashboards - Configure CloudWatch metrics dashboards
- Create Queries - Define reference queries for common investigations
- Test Investigations - Run investigations using CloudWatch logs and metrics
Need Help? - Contact Relvy support at [email protected] for assistance with AWS CloudWatch setup.

