Resource not found Error while using CLI Record Control
First, I want to say that I am completely new to this. When trying to use the CLI to batch upload items to my dynamodb, I get the following error:
An error occurred while calling the BatchWriteItem operation (ResourceNotFoundException): The requested resource was not found
The command I'm running is here: aws --no-verify-ssl dynamodb batch-write-item -request-items file: //program.json
The content of the JSON file is here:
{
"Program": [
{
"PutRequest": {
"Item": {
"programName": {"S":"Yogi Bear"},
"activeInd": {"S":"Y"}
}
}
},
{
"PutRequest": {
"Item": {
"programName": {"S":"Salad for Lunch"},
"activeInd": {"S":"Y"}
}
}
}
]
}
I have compared this with examples in the documentation and I see no problem. I tried to just add a single item using put-item and got the same error. If you have any suggestions, please let me know. Thanks in advance.enter code here
source to share
Make sure the table "Program" exists
From DynamoDB documentation:
ResourceNotFoundException
Message: The requested resource was not found.
Example. The table that is being requested does not exist or is too early in the CREATE state.
In your JSON file "Program" is for the name of an already existing table. It looks like it is not, both in this batch and in your single case, simply because the table does not exist.
Make sure this table already exists using the list-tables command :
aws dynamodb list-tables
If not, create it using the create-table command .
Check that the scope of your CLI is the same as your table
If this table exists, check your cli config to make sure you are querying in the same region as the table. You can check your default region like this:
aws configure get region
You can use aws configure
to change your default settings, or specify --region
directly in any CLI command to override the default scope.
additional literature
source to share