amazon-web-servicesamazon-dynamodbaws-clipartiql

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

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