- Newest
- Most votes
- Most comments
The reason you see this is because DynamoDB creates the file to store data under a directory named using your credentials, so for every set of credentials provided, its like a new "account" for DynamoDB local. To overcome that, you can use the sharedDb
option to share a single file between all access keys.
-
If you use the -sharedDb option, DynamoDB creates a single database file named shared-local-instance.db. Every program that connects to DynamoDB accesses this file. If you delete the file, you lose any data that you have stored in it.
-
If you omit -sharedDb, the database file is named myaccesskeyid_region.db, with the AWS access key ID and AWS Region as they appear in your application configuration. If you delete the file, you lose any data that you have stored in it.
-
If you use the -inMemory option, DynamoDB doesn't write any database files at all. Instead, all data is written to memory, and the data is not saved when you terminate DynamoDB.
Even when using the -inMemory option, you must still provide -sharedDb to have all access keys share the same in memory location.
Defined in DynamoDB Local Notes
Relevant content
- asked a year ago
- asked 9 months ago
- asked 7 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
Ahhh, I didn't realize
-sharedDb
affected-inMemory
too. Thanks!One followup question though; Why does the 2nd way in my example work? The access-key-id's are still different between the jar and cli ... unless moving them to environment variables makes them no longer apply and so the cli acts as if it has empty-strings like the jar? But at the same time, it seems like
AWS_REGION
is perfectly functional.In your specific instance, it could possibly be cause by the absence of key as you use
""
an empty string which is possibly treated as null.