Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

AWS CLI PartiQL INSERT statement returns "ExecuteStatement operation: Requested resource not found"

I’m following the instructions in the AWS developer guide tutorial and just changed the names of the attributes. I can’t seem to make the INSERT INTO tablename VALUE statement work.

I created the table resourceLock & ensured it was fully created (TableStatus = ACTIVE):

aws dynamodb create-table --profile free --output table \
    --table-name resourceLock \
    --attribute-definitions \
        AttributeName=resourceType,AttributeType=S \
        AttributeName=resourceName,AttributeType=S \
    --key-schema \
        AttributeName=resourceType,KeyType=HASH \
        AttributeName=resourceName,KeyType=RANGE \
    --billing-mode=PAY_PER_REQUEST \
--table-class=STANDARD \

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Then, I tried to run the below statement:

aws dynamodb execute-statement  --statement "INSERT INTO resourcelock VALUE {'resourceName':'dev', 'resourceType':'environment'}"  --profile free

Which gave me the error:

An error occurred (ResourceNotFoundException) when calling the ExecuteStatement operation: Requested resource not found

I’ve tried a number of variations on the syntax but I can’t seem to get it to work from the cli.

I can add items via the AWS Console so not sure what’s wrong.

enter image description here

>Solution :

A table is created with the name resourceLock (upper-case L), but the execute-statement command is using resourcelock (lower-case L).

Table names are case-sensitive in DynamoDB, so this should work:

aws dynamodb execute-statement  --statement "INSERT INTO resourceLock VALUE {'resourceName':'dev', 'resourceType':'environment'}"  --profile free
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading