Skip to content Skip to sidebar Skip to footer

Using Local Endpoint With Boto2

I am trying to mock AWS s3 api calls using boto2. I create local s3 endpoint using localstack and can use this using boto3 easily as below, import boto3 s3_client = boto3.client('s

Solution 1:

This works for me:

import boto
from boto.s3.connection import S3Connection
region = boto.s3.S3RegionInfo(name='test-s3-region', endpoint='http://127.0.0.1:4572/', connection_cls=S3Connection)
conn = region.connect()
print conn.get_bucket('test-poc')

You need to set the connection_cls attribute wish is NoneType by default.

Post a Comment for "Using Local Endpoint With Boto2"