I am struggling with using aws-cli with dynamoDB running on my local machine, could anyone please help.
DynamoDB Local with the following configuration:
Port: 8000 InMemory: false DbPath: null SharedDb: true shouldDelayTransientStatuses: false CorsParams: *
any help appreciated.
To access DynamoDB running locally, use the --endpoint-url parameter. The following is an example of using the AWS CLI to list the tables in DynamoDB on your computer. The AWS CLI can't use the downloadable version of DynamoDB as a default endpoint. Therefore, you must specify --endpoint-url with each AWS CLI command.
DynamoDB Local is available as a download (requires JRE), as an Apache Maven dependency, or as a Docker image. If you prefer to use the Amazon DynamoDB web service instead, see Setting up DynamoDB (web service).
To run the dynamodb commands, you need to: AWS CLI installed, see Installing or updating the latest version of the AWS CLI for more information. AWS CLI configured, see Configuration basics for more information. The profile that you use must have permissions that allow the AWS operations performed by the examples.
From the documentation:
Using the AWS CLI with Downloadable DynamoDB
The AWS CLI can interact with DynamoDB running on your computer. To enable this, add the --endpoint-url parameter to each command:
--endpoint-url http://localhost:8000
Here is an example, using the AWS CLI to list the tables in a local database:
aws dynamodb list-tables --endpoint-url http://localhost:8000
Note: if you don't have any AWS credentials configured yet, the command above may fail with You must specify region
or Unable to locate credentials
error. For the local connection any credentials would work, so arbitrary values can be used, for example, like this:
AWS_ACCESS_KEY_ID=X AWS_SECRET_ACCESS_KEY=X aws dynamodb list-tables --endpoint-url http://localhost:8000 --region x
All is need is to run aws configure
:
aws configure AWS Access Key ID [None]: "fakeMyKeyId" AWS Secret Access Key [None]: "fakeSecretAccessKey" Default region name [None]: x Default output format [None]:
After that.
aws dynamodb list-tables --endpoint-url http://localhost:8000 { "TableNames": [] }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With