amazon web services - Resource Not Found Error when using CLI batch-write-item -


first, want new @ this. when trying use cli batch load items dynamodb, following error:

an error occurred (resourcenotfoundexception) when calling batchwriteitem operation: requested resource not found

the command run here: aws --no-verify-ssl dynamodb batch-write-item --request-items file://program.json

the json file contents here:

{     "program": [         {             "putrequest": {                  "item": {                     "programname": {"s":"yogi bear"},                     "activeind": {"s":"y"}                 }             }         },         {             "putrequest": {                  "item": {                     "programname": {"s":"salad lunch"},                     "activeind": {"s":"y"}                 }             }         }     ] } 

i've compared examples in documentation , can't see problem. tried simple add individual item using put-item , got same error. if have suggestions, please let me know. in advance.enter code here

verify "program" table exists

from dynamodb documentation:

resourcenotfoundexception

message: requested resource not found.

example: table being requested not exist, or in creating state.

in json file, "program" intended name of table exists. sounds failing in both batch , in single put case because table not exist.

check table exists list-tables command:

aws dynamodb list-tables

if not, create create-table command.

verify cli default region same table

if table exist, check cli configuration verify you're querying in same region table exists. can check default region this:

aws configure region 

you can use aws configure change default settings, or specify --region directly on cli command override default region.

further reading


Comments