fatal error: [Errno 13] Permission denied: '/.aws' when using Environment credentials source #9075
Labels
bug
This issue is a bug.
configuration
investigating
This issue is being investigated and/or work is in progress to resolve the issue.
p3
This is a minor priority issue
Describe the bug
The AWS CLI seems to not respect the same configuration sources as the normal AWS SDK, instead it enforces the existence of a
$HOME/.aws/config
, and completely fails if it doesn't exist and can't be created... even if all the configuration was available through the environment.Regression Issue
Expected Behavior
The AWS CLI should support all standard methods of passing AWS Credentials without arbitrary requirements
Current Behavior
The AWS CLI attempt to read/create a directory in $HOME and crashes if it can't, even if proper configuration was supplied through environment variables.
Reproduction Steps
Start a container with this image (or similar): https://hub.docker.com/r/bitnami/aws-cli
Mount credentials through environment, or IRSA: https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html
With this configuration the AWS CLI will fail with:
fatal error: [Errno 13] Permission denied: '/.aws'
Possible Solution
Fail gracefully and attempt other configuration sources instead of attempting to create a non-existent directory. Honestly I don't see why it should create that directory at all if configuration is supplied through the environment.
Additional Information/Context
No response
CLI version used
aws-cli/2.21.0 Python/3.11.10 Linux/6.1.102 source/x86_64.debian.12
Environment details (OS name and version, etc.)
Docker: bitnami/aws-cli:latest
The text was updated successfully, but these errors were encountered: