I'm trying to experiment with Localstack on a Windows 10 machine.
- I wish to use the localstack/localstack docker image.
- I also wish to use the amazon/aws-cli docker image for running commands against my Localstack instance. (e.g. create an S3 bucket).
- Do not want to install python/pip on my windows machine.
- Do not want to install aws-cli on my windows machine. (Note: I want to use docker images for aws-cli commands.)
So I seem to have Localstack running ok, but when I try and run an AWS command against the Localstack instance, I get an Unable to locate credentials error.
e.g.
CMD > docker run --rm -it amazon/aws-cli --endpoint-url=http://localhost:4566 s3 mb s3://testbucket
make_bucket failed: s3://testbucket Unable to locate credentials
and my docker file:
version: '3.2'
services:
localstack:
image: localstack/localstack # This will pull the latest
container_name: localstack
network_mode: bridge
ports:
- 4566:4566 # All servics will now go through the same port.
- "4571:4571"
- "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
environment:
- SERVICES=s3
- DEBUG=1
- DATA_DIR=/tmp/localstack/data # This is the where the data will be stored/saved, inside the docker instance
- PORT_WEB_UI=${PORT_WEB_UI- }
volumes:
- "localstack-vol:/tmp/localstack"
volumes:
localstack-vol:
Questions
Is it possible to run an AWS command (like create an S3 bucket) from the aws-cli docker image against a Localstack instance?
Is there a way I can specify credentials?
I also have a C:\Users\<username>\.aws config and credentials file(s) with the following:
Credentials
[<snip>]
aws_access_key_id=<snip>
aws_secret_access_key=<snip>
[localstack]
aws_access_key_id = foo
aws_secret_access_key = bar
config
[profile <snip>]
region = us-west-2
role_arn = arn:aws:iam::<snip>:role/local-development
source_profile = <snip>
[profile localstack]
region = us-west-2
output = json
Can someone see what I've done wrong, please?
