I try to use aws cli with docker images.
the command line like :
slu@machine:/c/work/dfsi$ export AWS_PROFILE=role-development
slu@machine:/c/work/dfsi$ aws ecr get-login
An error occurred
(AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::XXXXXXXXXXXX:user/slu is not authorized to perform: ecr:GetAuthorizationToken on resource: *
but I can do:
aws ecr get-login --profile=role-development
What I want to do isn't obviously write --profile and try to do it with hidden --profile variable?
How to do that?
The below environmental variable is working for me as expected.
AWS_DEFAULT_PROFILE=profile-name
echo $AWS_DEFAULT_PROFILE to see what's your environment variable.export AWS_DEFAULT_PROFILE=your_aws_default_profile_nameTo verify, simply run aws iam list-users to see what comes back based on your profile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With