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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则