- Newest
- Most votes
- Most comments
{"__type":"com.amazonaws.dynamodb.v20120810#MissingAuthenticationToken","Message":"Request must contain either a valid (registered) AWS access key ID or X.509 certificate."}
The reason you see this exception is because you curled
the endpoint, curl does not sign requests so the exception is expected.
As for your actual issue, you need to ensure that you use credentials to connect to DynamoDB Local. You need to use aws configure
to configure credentials (for local they do not have to be valid credentials).
As you already have credentials saved as local
then you should execute this command:
aws dynamodb list-tables \
--endpoint-url http://localhost:8000 \
--profile local \
--debug
--debug
will highlight where the request is failing, if it still fails.
Hi, if above does not fix it, I would suggest to follow this topic as could be related to some bug introduced in specific versions for local DynamoDB.
https://repost.aws/questions/QUHyIzoEDqQ3iOKlUEp1LPWQ#ANdBm9Nz9TRf6VqR3jZtcA1g
DynamoDB local requires Access Key ID and Secret Key ID to authenticate. This can be any set of valid credentials.
I would recommend setting up the Access Key ID and Secret Key ID in your AWS CLI -> https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
Then add the --profile parameter to the "aws dynamodb" command referencing the profile name you created when setting up the credentials.
aws dynamodb list-tables --endpoint-url http://localhost:8000 --profile myprofile
Sorry what does it mean: "This can be any set of valid credentials."? Where can I get the credentials for local DB? It has value by default? Or I need to specifiy it some how?
I have this in my credentials file
[local]
aws_access_key_id=dummy-access-key
aws_secret_access_key=dummy-access-key
and config
[local]
region = us-west-2
And I call it so
aws dynamodb list-tables --region local --endpoint-url "http://localhost:8000"
or so
aws dynamodb list-tables --profile local --endpoint-url "http://localhost:8000"
Do I need to use the keys or I need generate it some how? Or specifty it? Whant is wrong?
On your IAM user, you can generate a set of credentials -> https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html
What I meant by "This can be any set of valid credentials" is that the aws_access_key_id and aws_secret_access_key need to be an actual set of credentials generated in AWS.
Generate the credentials then update the local credentials file then you can simply run the following, You do not need to specify the region as local. The region parameter is only valid when we call AWS services in specific regions since we are using the --endpoint-url the CLI automatically calls the local instance.
aws dynamodb list-tables --endpoint-url http://localhost:8000 --profile local
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 25 days ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 4 months ago
Hi Leeroy. I have the exact same issue. I am running DDB in a docker container on my WSL Ubuntu. Everything is the same as the original poster except I can confirm that a netcat returns successfully, but anything else refuses to connect. Since this thread is only two weeks old, could this be a new bug or something like that?
nick@T490s:~/code$ aws dynamodb list-tables --endpoint-url http://127.0.0.1:8000 --profile default --debug Output here: https://pastebin.com/zfEBQnd9
Hi Nick, yours looks like a separate issue. Can you create a new question and include the version of Local you are using along with your Docker setup commands?
Hi Leeroy, thanks for the response. I made a separate issue here: https://repost.aws/en/questions/QUN54ZAARaQjSKRGgg-qPnog/