Is there any way to have Boto seek for the configuration files other than the default location, which is ~/.aws
?
The location of the config file used by Boto3. By default this value is ~/. aws/config .
The shared credentials file has a default location of ~/. aws/credentials . You can change the location of the shared credentials file by setting the AWS_SHARED_CREDENTIALS_FILE environment variable.
In Windows, create a text file that has any name (e.g. boto. config). It's recommended that you put this file in your user folder. Then set a user environment variable named BOTO_CONFIG to the full path of that file.
It's not clear from the question whether you are talking about boto or boto3. Both allow you to use environment variables to tell it where to look for credentials and configuration files but the environment variables are different.
In boto3 you can use the environment variable AWS_SHARED_CREDENTIALS_FILE
to tell boto3 where your credentials file is (by default, it is in ~/.aws/credentials
. You can use AWS_CONFIG_FILE
to tell it where your config file is (by default, it is in ~/.aws/config
.
In boto, you can use BOTO_CONFIG
to tell boto where to find its config file (by default it is in /etc/boto.cfg
or ~/.boto
.
Yes, you can install the configuration file (for site-wide settings that all users on this machine will use) in:
nano /etc/boto.cfg
[Credentials]
aws_access_key_id = your_key
aws_secret_access_key = your_password
Other possible locations could be:
~/.aws/credentials
for credentials shared between SDKs~/.boto
for user-specific settings~/.aws/credentials
for credentials shared between SDKs~/.boto
for user-specific settingsIf 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