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 Respuesta
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
EXPERTO
kentrad
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas