CloudWatch Agent Metrics in Monitoring Account Alarms

Hi there,

I’m fairly new to Terraform and AWS and I’m really struggling with alarms in my Monitoring account. Please excuse if I might use terms incorrectly. I’ll do my best to learn and try to describe what I have and what I want to achieve.

I have many workload accounts connected via OAM link to my sink in the monitoring account. This is done via a JSON file with the account ids that are used in a local-block. That way I create a dashboard for each account with a for_each loop. The dashboard includes AWS/EC2 CPU, EBS Read, EBS Write etc., but also Metrics from the Windows system. RAM Utilization, Hard Disk usage etc.

While I managed to create alarms dynamically for each account connected for e.g. AWS/EC2 CPUUtilization, I can’t get CloudWatch Agent metrics as the source/trigger for alarms.
At the moment I want to create an alarm when a “Logical Disk % Free” drops below 10 %.

In Metrics I can see that the historic and current values are available/visible in the monitoring account. I simply don’t get how the code must look to work to create an alarm per workload account. No matter what I have tried I always get “Insufficient data”.

Is there anyone who creates alarms for CloudWatch Agent metrics dynamically in the monitoring account and would kindly share a snippet? Or has any link where I can get more info or examples?