I have a role and I am trying to write a python script to access S3. It says boto3exception credentials not found. Do I need an AWS access key and password and keep in ~./aws/credentials to access S3?
CodePudding user response:
There are different ways in which you can supply credentials to boto3.
From the documentation:
The order in which Boto3 searches for credentials is:
- Passing credentials as parameters in the boto.client() method
- Passing credentials as parameters when creating a Session object
- Environment variables
- Shared credential file (~/.aws/credentials)
- AWS config file (~/.aws/config)
- Assume Role provider
- Boto2 config file (/etc/boto.cfg and ~/.boto)
- Instance metadata service on an Amazon EC2 instance that has an IAM role configured.
these are evaluated in order. Whichever one evaluates to credentials will be used.