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回答
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
回答済み 2年前
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).

回答済み 2年前

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

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

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