-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK not loading assumed role credentials unless run as sudo #4255
Comments
Hey @martinpllu thanks for opening this issue, it does seem weird that you have to sudo run the script. ~/.aws/config:
~/.aws/credentials:
It does seem to be some permissions issue looking at the original error Can you check having a setup like that works for you? thanks |
Hi @ajredniwja, thanks for the response. I tried to replicate your config above as closely as possible: ~/.aws/config:
~/.aws/credentials:
My environment is as follows:
I still see a similar error when running as non-sudo, i.e.
|
It must have to be something with the config as I am not able to reproduce using the setup mentioned above. |
This may be related?: #4406 |
Describe the bug
(Originally asked as question in #4252, but at this stage an issue feels more appropriate)
I want to be able to run SDK code with assumed role credentials. I have the following in
~/.aws/config
With this config I can run CLI commands like
aws s3 ls
, and I periodically get prompted for an MFA code as expected.Now I'd like to run a script with these credentials. For example:
My environment is set up as follows:
When I run the script above I get the following error:
However, when I run the script using sudo, it works.
My first thought was that there was a permission issue with files in
~/.aws
, perhaps in the files under~/.aws/cli
that are created when assuming a role. However even after runningsudo chown -R $USER ~/.aws
andsudo chmod -R 777 ~/.aws
I still see the same error, unless I run the script as sudo.Expected Behavior
see above
Current Behavior
see above
Reproduction Steps
see above
Possible Solution
No response
Additional Information/Context
No response
SDK version used
2.1238.0
Environment details (OS name and version, etc.)
MacOS Monterey 12.2.1, aws-sdk 2.1238.0, CLI version
aws-cli/2.8.4 Python/3.10.8 Darwin/21.3.0 source/arm64 prompt/off
The text was updated successfully, but these errors were encountered: