Access Denied after successful AssumeRole

0

Good Day All,

I am trying to run commands after assumerole using cli and getting the following error: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied

aws sts assume-role --role-arn "arn:aws:iam::<accountid>:role/read-write-app-bucket-role" --role-session-name "sessionname" This runs successfully but when i do the following i get error : command : aws s3 ls

Note :

  1. I am able to assume the role successfully using AWS STS and getting temp credentials
  2. Also the role has full S3 access.
  3. Both role and resource are in same account

Tried running "aws s3 ls --profile default" but still having the issue Tried assigning the same role directly to the user and the command works fine.

질문됨 10달 전191회 조회
2개 답변
0

Hi The command assume-role output the temporary credentials. You must use these credentials when making your aws s3 ls call. Please see this guide. Hope it helps.

profile picture
전문가
답변함 10달 전
0

Hi, I suggest you to check the identity under which run the s3 ls via aws sts get-caller-identity. Sometimes your run CLI commands under under another identity than the one you believe due to env vars, default profile, etc.

It happens to me sometimes...

Best,

Didier

profile pictureAWS
전문가
답변함 10달 전

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

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

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

관련 콘텐츠