localstack

using local endpoint with boto2

对着背影说爱祢 提交于 2020-01-05 04:12:12
问题 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('s3', endpoint_url='http://localhost:4572') bucket_name = 'my-bucket' s3_client.create_bucket(Bucket=bucket_name) But I did not find way to do this using boto2. Is there any way preferably using ~/.boto or ~/.aws/config? Tried providing endpoint with boto2 but it failed. import boto boto.s3.S3RegionInfo(name='test-s3

Redirect AWS sdks' default endpoint to mocked localstack endpoints

爱⌒轻易说出口 提交于 2019-12-10 17:57:17
问题 I have multiple Java spring boot services (around 20 of them) using Amazon SDKs for S3, SQS, DynamoDB, etc.. Currently, to use Amazon Web Service I only need to specify my AWS key & secret. ACCESS_AWS_KEY=<MY_KEY> ACCESS_AWS_SECRET=<MY_SECRET> However, I wanted to setup offline dev enviroment so I started to dockerize my services and set up a single multi-docker container with all my services dockerized and localstack should be used instead of remote AWS service to allow complete offline