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
asked 5 months ago150 views
1 Answer
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
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions