Moto: mock_s3 not working

Created on 4 Aug 2017  路  3Comments  路  Source: spulec/moto

Python version: 2.7.10

Package versions

moto==1.0.1
boto==2.48.0
boto3==1.4.5
botocore==1.5.92

```python
from moto import mock_s3
from boto.s3.connection import S3Connection
with mock_s3():
conn = S3Connection(CONFIG_DATA['bucket_access_key'], CONFIG_DATA['bucket_secret_key'])
conn.create_bucket(CONFIG_DATA['bucket_name'])

I am getting the below error on `conn.create_bucket`.

```XML
S3ResponseError: S3ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidAccessKeyId</Code><Message>The AWS Access Key Id you provided does not exist in our records.</Message><AWSAccessKeyId>bucket_access_key</AWSAccessKeyId><RequestId>B04B70FEBB10B9B7</RequestId><HostId>ZlQqWyrZYShVsOBxo6BRZQZIlWB2SiiD7H8q7mQVwHVoW72WJIKjBEOeRarHAolQNynCKOaJCwg=</HostId></Error>

Any help would be highly appreciated.

Most helpful comment

@muhammad-amar you want to use @mock_s3_deprecated if you're using boto. The other one is for boto3

All 3 comments

@muhammad-amar you want to use @mock_s3_deprecated if you're using boto. The other one is for boto3

馃憤 @JackDanger Thanks a lot. This solved my problem.

maybe this should be mentioned somewhere in the docs?
http://docs.getmoto.org/en/latest/index.html

Was this page helpful?
0 / 5 - 0 ratings