Im trying to setup Localstack and AWS Cli
I have installed sudo snap install aws-cli --classic
to run command
This is my compose:
services:
localstack:
image: localstack/localstack
ports:
- "4566:4566"
- "4571:4571"
environment:
- AWS_ACCESS_KEY_ID=dummy
- AWS_SECRET_ACCESS_KEY=dummy
- AWS_DEFAULT_REGION=us-east-1
- SERVICES=dynamodb,s3,sns,sqs,kms,lambda,cloudformation,cloudwatch
When i run command aws s3 mb s3://books --endpoint-url=http://localhost:4566
i see on console
make_bucket failed: s3://books Unable to locate credentials
As i understand this env variables available on docker container because previously i set this property from the command aws configure
and it works. What i do wrong in my yaml file ?
When i try to open health in browser i see this Error. What i missed ?
I want to set credentials AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION in docker compose file (i don’t know why this set up wrong) and i want to see health on browser
2
Answers
The environement varaiables are only accessible in your Localstack container, not in your local machine but anyway Localstack doesn’t need this ENV varaiables to function but other tools like AWS CLI needs this to be set to function.
So you can execute your make bucket without signing :
but this doesn’t work for all commands.
You can also execut your aws cli commands directly in your container :
Or from your local machine :
You need to set some of these configuration variables manually in your shell session, like:
.. and then run the command:
The health endpoint that you are trying to access has been deprecated. The new endpoint is:
Hope this helps!