CloudWatch get resourceType metric data

0

I want to get metric data to CloudWatch dashboard.

( I using get_metric_data() method )

but, explorer type can't get metric data

example, I can obtain metric data in the following format:

"metrics": [
    ["AWS/EC2", "CPUUtilization", "InstanceId", "i-0b...", { "period": 300, "stat": "Average" }]
]

but I can't get metric data of:

"metrics": [
  {
      "metricName": "CPUUtilization",
      "resourceType": "AWS::EC2::Instance",
      "stat": "Average"
  }
]

How do I get resourceType metric data?

ari
質問済み 6ヶ月前166ビュー
1回答
0

Hello.

There is no option to specify resourceType in get_metric_data().
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudwatch/client/get_metric_data.html

Do you know the namespace where "resourceType": "AWS::EC2::Instance" is saved?
If you know the namespace, there is a possibility that you can get it using get_metric_data().

profile picture
エキスパート
回答済み 6ヶ月前

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

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

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

関連するコンテンツ