serverless-dynamodb-local
serverless-dynamodb-local copied to clipboard
Migrate should respect locally configured credentials
Actual Behaviour
Regardless of the user's local environment configuration, all database migrations are run with mock access/secret key ids. This is both poorly documented and inconsistent with expecations; it also results in failed interactions with tables as noted in #183
Expected Behaviour
The existing behaviour is fine as a fallback; however, if AWS_ACCESS_KEY_ID and/or AWS_SECRET_ACCESS_KEY are set on the environment (as is common in most AWS-based infrastructures), those should be used instead.
Steps to reproduce it
- Configure your local environment with either (or both)
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY - Run
sls dynamodb migrateto migrate tables configured in yourserverless.yml - Verify a failure to connect by either:
3a. Using the
awscli:aws dynamodb list-tables --endpoint-url http://localhost:80003b: Using theAWS.DynamoDBorAWS.DynamoDB.DocumentClientSDKs
You'll notice that both 3a and 3b above result in the tables created by migration not being found.
Screenshots of the issue
serverless-dynamodb-local can find the tables that it created earlier:

...however, awscli cannot not:

Would you like to work on the issue?
https://github.com/99xt/serverless-dynamodb-local/pull/204