Reputation: 5550
Trying to create a Lambda to update DynamoDB from a Kinesis stream. Here is my update statement:
var response = dd.updateItem({
'Key': {'S': payload.identityId},
'TableName': 'Users',
'UpdateExpression': 'SET testVal = :testVal',
'ExpressionAttributeValues': {
':testVal': {'S': 'This is a test'}
}
}
That generates 47 error messages:
InvalidParameterType: Expected params.Key['S'] to be a structure
UnexpectedParameter: Unexpected key '0' found in params.Key['S']
...
The Users
table exists and is currently empty. I've double checked the identityID exists (and is valid). Can anyone see what I'm doing wrong here?
Upvotes: 3
Views: 1977
Reputation: 5550
Figured this out. Sometimes just posting the question makes you think about it differently!
I wasn't passing the Key
correctly.
dd.updateItem({
'Key': {
'hashAttributeName': {
'S': payload.identityId
}
},
'TableName': 'Users',
'UpdateExpression': 'SET testVal = :testVal',
'ExpressionAttributeValues': {
':testVal': {'S': 'This is a test'}
}
}
Upvotes: 6