Is there a way to AWS services and it return the policy or role attached to it?

0

I have a use case where I am trying to use CLI to see the policies attached to each role that list write based policies.

However, the only data I hae is the service of the role. Opposed to the actuall role itself.

I'm wondering if there's a process to do this and receive this information for services such as Lambdas, EC2, and ECS instances?

1回答
0

You could do something like this in the CLI:

aws iam list-roles --query Roles[?AssumeRolePolicyDocument.Statement[0].Principal.Service==\`lambda.amazonaws.com\`].RoleName

This will get you the roles that IAM trusts Lambda to assume.

profile pictureAWS
エキスパート
kentrad
回答済み 1年前

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

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

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

関連するコンテンツ