Can I use boto3 anonymously?

Each Answer to this Q is separated by one/two green lines.

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?

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

Disable signing

import boto3

from botocore.handlers import disable_signing
resource = boto3.resource('s3')'choose-signer.s3.*', disable_signing)

None of these seem to work as of the current boto3 version (1.9.168). This hack (courtesy of an unfixed github issue on botocore) does seem to do the trick:

client = boto3.client('s3', aws_access_key_id='', aws_secret_access_key='')
client._request_signer.sign = (lambda *args, **kwargs: None)

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .