IAM Policy to get specific CloudWatch GetMetricData, ListMetrics

0

I set IAM Policy to get CloudWatch GetMetricData, ListMetrics about specific instance or lambda. but I get all metrics. I don't want to get all metrics. How can I get specific instance or lambda using IAM Policy?

2回答
0

You can restrict access to specific alarms and dashboards by using their Amazon Resource Names (ARNs) in your policies.

Please follow the below link for more details: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/iam-access-control-overview-cw.html

profile pictureAWS
回答済み 2年前
  • In this link, "Resource – Use an Amazon Resource Name (ARN) to identify the resource that the policy applies to. CloudWatch does not have any resources for you to control using policies resources, so use the wildcard character (*) in IAM policies. For more information, see CloudWatch resources and operations." I tested this using ARN. this can't be applied. I think I can't get specific metric data. Is it right? @Gautam Kumar

0

Unfortunately, if you look at https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazoncloudwatch.html, you will see it is currently not possible to restrict GetMetricData or ListMetrics with any resource type or condition key - which corresponds to the sentence you highlighted that explains you have to use the wildcard character (*) in IAM policies.

I am not aware of a workaround and wouldn't know what to advise.

profile pictureAWS
Jsc
回答済み 2年前

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

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

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

関連するコンテンツ