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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠