Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use boto3 anonymously?

With boto I could connect to public S3 buckets without credentials by passing the anon= keyword argument.

s3 = boto.connect_s3(anon=True) 

Is this possible with boto3?

like image 608
MRocklin Avatar asked Jan 18 '16 23:01

MRocklin


People also ask

Should I use boto3 resource or client?

To summarize, resources are higher-level abstractions of AWS services compared to clients. Resources are the recommended pattern to use boto3 as you don't have to worry about a lot of the underlying details when interacting with AWS services. As a result, code written with Resources tends to be simpler.

What credentials does boto3 use?

Configuring credentials There are two types of configuration data in Boto3: credentials and non-credentials. Credentials include items such as aws_access_key_id , aws_secret_access_key , and aws_session_token .


1 Answers

Yes. Your credentials are used to sign all the requests you send out, so what you have to do is configure the client to not perform the signing step at all. You can do that as follows:

import boto3 from botocore import UNSIGNED from botocore.client import Config  s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED)) # Use the client 
like image 153
Jordon Phillips Avatar answered Oct 02 '22 23:10

Jordon Phillips