Create dynamic cross account CloudWatch Dashboard

1

Currently any time I add an EC2 instance, I need to manually add the metric to the existing widget(s) in my CloudWatch Dashboard. I know there are Automatic Dashboards that are "Resource Aware" so that any time a new instance is added/removed their respective widgets are updated accordingly automatically. How do I mirror that capability in my widgets for cross account dashboards?

AWS
AWSJoe
質問済み 2年前747ビュー
1回答
1

Hi Joe,

Thanks for your question. Keeping your Dashboard dynamically up to date is no easy job but with Metrics Explorer [1] and Search Expression [2] it can be tackled quite simply.

Metrics Explorer is a feature that allows you to dynamically populate metrics by the resource tags. For instance in your case, we can filter by the Instance Name tag or any other tag that you find common around the EC2 instances that you dynamically want to monitor on your Dashboard. Metrics Explorer Console view example

Once you create the graphs on your Explorer, you can add it as a Metrics Explorer widget to the Dashboard.

Alternatively, Search Expression can be also used here and it supports searching by the Namespace, Metric Name, Dimension Name and Dimension Values. For instance you can use below search expression to find all the CPUUtilization metrics from AWS/EC2 namespace with InstanceId schema(which is the dimension list for that metric).

SEARCH('{AWS/EC2,InstanceId} MetricName="CPUUtilization"', 'Average', 300)

Search Expression example

Please check the related documents for detail information and including the limitations as well.

Hope this helps!

Thanks

AWS
サポートエンジニア
回答済み 2年前
  • Hi @Munkhbat_T, I appreciate your answer! I've used Metric Explorer in the past without issue, my blocker here is that it's only of use in a singular account. I was wondering if there's a way to do the same type of build out for cross account dashboards.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ