Start localstack with just S3 running on port 4572 in region us-west-2
.
docker run -e "SERVICES=s3:4572" -e "DEFAULT_REGION=us-west-2" -p 4572:4572 localstack/localstack
Create an S3 bucket:
aws --endpoint-url=http://localhost:4572 s3 mb s3://test-bucket
List buckets:
aws --endpoint-url=http://localhost:4572 s3 ls
You should see the bucket you just created.
Upload an object to your bucket:
touch ~/Desktop/foo.txt
aws --endpoint-url=http://localhost:4572 s3 cp ~/Desktop/foo.txt s3://test-bucket
List objects in your bucket:
aws --endpoint-url=http://localhost:4572 s3 ls s3://test-bucket
You should see the file you uploaded.