Is it possible to use cloudwatch describe-alarms-for-metric to describe cross-accounts alarms?
#8525
Replies: 1 comment 1 reply
-
|
In a cross-account monitoring setup, you can see the metric in the console because it is being shared/linked, but your CLI call will return nothing if the metric identity you provide does not exactly match what the alarm references. For cross-account metrics, you must include the metric’s source account in the request (AccountId), otherwise CloudWatch searches only “local account” metrics. Use the newer metric identifier form and specify AccountId (and make sure Dimensions match exactly): aws cloudwatch describe-alarms-for-metric If your CLI version does not support Use aws cloudwatch describe-alarms Or, if you know the alarm name prefix, use: aws cloudwatch describe-alarms --alarm-name-prefix "..." Summary: Yes, it is possible, but only if you provide the exact metric identity the alarm was created with, and for cross-account metrics that includes the source AccountId. If your CLI build lacks the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone, I'm facing the following issue:
I have a monitoring account where I would like to describe all the alarms associated with a specific metric. But that metric comes from a different AWS account, the alarm was created in the monitoring account but not the metric. So when I use
describe-alarm-for-metricfrom the monitoring account it doesn't find anything. I can see the metric from the AWS Console but I'm guessing the cli only finds it if it was originally created in that account. At the moment I have no way of specifying where the metric originated.Beta Was this translation helpful? Give feedback.
All reactions