How to let IAM Identity Center user operate Lightsail container via AWS CLI?

0

Hi guys, I am newbie here. I have create a user in IAM Identity Center with AdministratorAccess permission, I can use this user to deploy the lightsail container in aws console, but I can't upload image via cli , it be rejected as below: Enter image description here

Does anyone knows how to solve it? thanks

1 個回答
1
已接受的答案

Hello.

If you are an IAM Identity Center user, you cannot use it unless you also set "aws_session_token" in addition to the access key and secret access key.
So, please try setting the "~/.aws/credentials" file as follows.

[yyyyyyyy_AdministratorAccess]
aws_access_key_id=yyyyyyyyyyyy
aws_secret_access_key=yyyyyyyyyyy
aws_session_token=yyyyyyyyyyyyy.....

Or you can use it by running the command to set environment variables as shown below.

export AWS_ACCESS_KEY_ID="yyyyyyyyyyyy"
export AWS_SECRET_ACCESS_KEY="yyyyyyyyyyyy"
export AWS_SESSION_TOKEN="yyyyyyyyyyyyy....."

One way is to use the "aws configure sso" command.
https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-token.html#sso-configure-profile-token-auto-sso

profile picture
專家
已回答 6 個月前
profile picture
專家
已審閱 2 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南