Boto3: Equivalent of aws s3 cp with --no-sign-request for boto3.client() ?

Created on 29 Jul 2017  路  2Comments  路  Source: boto/boto3

We have a S3 bucket that is public and requires no authentication, yet we cannot access it via boto3 unless there are credentials configured in one of these modes: http://boto3.readthedocs.io/en/latest/guide/configuration.html#configuring-credentials

The only one that actually doesn't require an aws account, would be the IAM role configuration, but we don't control the instance. Is there an equivalent boto3.client() call that would work like 'aws s3 cp s3:/// --no-sign-request' ?

closing-soon question

Most helpful comment

Yep. All you need to do is the following:

>>> import boto3
>>> from botocore import UNSIGNED
>>> from botocore.config import Config
>>> s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED))

And from there any request made from the client will not be signed. Let us know if you have anymore questions.

All 2 comments

Yep. All you need to do is the following:

>>> import boto3
>>> from botocore import UNSIGNED
>>> from botocore.config import Config
>>> s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED))

And from there any request made from the client will not be signed. Let us know if you have anymore questions.

This works, thanks! My only other comment would be to update the documentation, in the Configuration/Credentials section to mention this.

Was this page helpful?
0 / 5 - 0 ratings