python - using local endpoint with boto2 -


i trying mock aws s3 api calls using boto2. create local s3 endpoint using localstack , can use using boto3 below,

import boto3 s3_client = boto3.client('s3', endpoint_url='http://localhost:4572') bucket_name = 'my-bucket' s3_client.create_bucket(bucket=bucket_name) 

but did not find way using boto2. there way preferably using ~/.boto or ~/.aws/config?

tried providing endpoint boto2 failed.

import boto boto.s3.s3regioninfo(name='test-s3-region', endpoint='http://127.0.0.1:4572/') s3 = boto.s3.connect_to_region('test-s3-region') print s3.get_bucket('test-poc') 

error:

attributeerror: 'nonetype' object has no attribute 'get_bucket' 

i looking use local endpoints aws services testing purpose.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -