Autosave: 2024-06-23 12:30:05

This commit is contained in:
thomasabishop 2024-06-23 12:30:05 +01:00
parent 35f3a8ac48
commit c0876f7562
3 changed files with 33 additions and 7 deletions

Binary file not shown.

View file

@ -7,17 +7,21 @@ created: Saturday, June 22, 2024
# DynamoDB CLI commands # DynamoDB CLI commands
## Connecting to a local (Docker) DynamoDB instance ## Connecting to a local (Docker)/prod (AWS) DynamoDB instance
In order to distinguish between local and production accounts you should keep In order to distinguish between local and production accounts you should keep
seperate configs in `.aws/config` and `.aws/credentials`. Then specify the seperate profiles for each (via `.aws/config` and `.aws/credentials`).
profile if you are working locally and the local URL. Without the `--profile`
flag, AWS will default to the `default` profile which will typically be your When connecting to a local DB use the local profile and the local URL. Without
credentials for accessing AWS on the remote. the `--profile` flag, AWS will default to the `default` profile which will
typically be your credentials for accessing AWS on the remote.
For example:
```sh ```sh
aws dynamodb list-tables --profile timetracking_dev --endpoint-url aws dynamodb list-tables \
http://localhost:800 --profile timetracking_dev \
--endpoint-url http://localhost:800
``` ```
## Delete a table ## Delete a table

View file

@ -0,0 +1,22 @@
---
id: 8b6h
title: DynamoDB SDK commands
tags: [AWS, databases, dynamodb]
created: Sunday, June 23, 2024
---
# DynamoDB SDK commands
The following commands are for using `$aws-sdk/client-dynamodb` (the JS SDK).
## Create client
```js
const params = {
region: "eu-west-2",
accessKeyId: process.env.ACCESS_KEY_ID,
secretAccessKey: process.env.ACCESS_KEY_ID,
};
```
## Related notes