Closed mmg10 closed 2 years ago
Hi @mmg10.
In addition to changing the endpoint, awslocal
also modifies the following environment variables:
AWS_DEFAULT_REGION
- is set to the value of DEFAULT_REGION
, or the value of AWS_DEFAULT_REGION
, or us-east-1
.AWS_ACCESS_KEY_ID
- is set to test
if it's not setAWS_SECRET_ACCESS_KEY
- is set to test
if it's not setAWS_DATA_PATH
- is unset if it's setIn your case, I guess you are not defining the region as an env var, but as a config in ~/.aws/config
.
Which in turn leads to using two different regions.
Defining the region in the awslocal
call would most likely fix your issue.
Could you maybe verify that this fixes your issue?
Just if you're interested, this happens here: https://github.com/localstack/awscli-local/blob/cca765afc7d0e63455d6ca36f277e36c2c15412a/bin/awslocal#L98-L123
Hi @alexrashed
Thanks, your tip helped me. Both of the following two methods work
awslocal kinesis list-streams --region us-east-2
OR
export AWS_DEFAULT_REGION=us-east-2
awslocal kinesis list-streams
So is there any advantage of using awslocal
at all? Seems like I would be better off creating an alias to aws --endpoint-url=http://localhost:4566
.
As mentioned in the README, it is a viable alternative to just use an alias instead of using awslocal
. As mentioned in the particular section this works for most use cases.
The issue you ran into is actually a feature. awslocal
sets a unified set of default configurations (credentials, region) if it is not explicitly set. This simplifies the scripts built with awslocal
and simplifies sharing those scripts (since the resulting resources will be the same for different users).
The awscli-local is not compatible with the aws cli from AWS. If I create a kinesis stream with
I can't view the streams using
I can only view the streams using
And vice-versa.
Since in both cases it is using localstack, they should give the same result (which is not the case!)