我正在使用aws-runas运行以下 aws-cli 命令:
aws-runas xxx-prod aws s3 ls
我收到以下错误:
FATAL NoCredentialProviders: no valid providers in chain caused by: EnvAccessKeyNotFound:
failed to find credentials in the environment. SharedCredsLoad: failed to load profile, xxx-
prod. EC2RoleRequestError: no EC2 instance role found caused by: RequestError: send request
failed caused by: Get http://169.254.169.254/latest/meta-data/iam/security-credentials/:
net/http: request canceled (Client.Timeout exceeded while awaiting headers)
我的~/.aws/credentials文件:
[default]
aws_access_key_id=ABC
aws_secret_access_key=XYZ
我的~/.aws/config文件:
[default]
region = us-east-1
output = json
[profile xxx-prod]
role_arn=arn:aws:iam::11111111:role/managed-role/AcctAdmin
mfa_serial =arn:aws:iam::2222222:mfa/abc@gmail.com