can't view dynamodb table from EC2 ssh session

0

I ssh into my EC2, my caller-identity is assume role. and i try to display dynamodb table test (created by user bob)using aws dynamodb scan --table-name test--region us-east-1. I got error: An error occurred (AccessDeniedException) when calling the Scan operation: User: arn:aws:sts::0********:assumed-role/ssm/i-****** is not authorized to perform: dynamodb:Scan onresource: arn:aws:dynamodb:us-east-1:0******:table/test, how can i switch user in EC2 ssh session to bob, so I can view the table, or there is better way to display dynamodb table in EC2 ssh session? thanks

2 Respuestas
1

To get access to your Amazon DynamoDB service in your local account, you need to update your Amazon EC2 Instance Profile by adding a IAM policy allowing at least the Action 'dynamodb:Scan'.

More information about:

AWS
kunzt
respondido hace 2 años
0

In your description, its not detailed how IAM is designed for your usecase. So its hard for me to comment on a better way. But based on your description, you might be able to go to the instance role (in IAM) corresponding to the EC2 instance (the i** in the ARN User: arn:aws:sts::0****:assumed-role/ssm/i-**) where you are ssh-ed and then add an inline permissions policy (in IAM) which is identical to the DynamoDB related permission policy associated with the user bob (in IAM).

respondido hace 2 años

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