Reputation: 4512
Is there any way to have Boto seek for the configuration files other than the default location, which is ~/.aws
?
Upvotes: 12
Views: 20542
Reputation: 369
Yes, you can:
from boto3 documentation
Please check the link for more information.
Upvotes: 0
Reputation: 830
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 settingsUpvotes: 2
Reputation: 45906
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
.
Upvotes: 10