Есть следующая лямбда функция:
const AWS = require('aws-sdk');
const s3 = new AWS.S3();
AWS.config.update({
region: "eu-central-1"
});
exports.handler = (event, context, callback) => {
const dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
dynamodb.query({
TableName: 'ToneySounds',
ProjectionExpression:"soundUuid, #c,#n",
KeyConditionExpression: '#n = :n',
ExpressionAttributeValues: {
':n': {S: 'filename'},
},
ExpressionAttributeNames:{
"#n": "name",
"#c": "collection"
},
}, function(err, data) {
if (err) {
console.log(err, err.stack);
callback(null, {
statusCode: '500',
body: err + err.stack
});
} else {
callback(null, {
statusCode: '200',
body: JSON.stringify(data.Items)
});
}
});
};
И такой обьект в DynamoDB
{
"a": {
"N": "1"
},
"collection": {
"S": "CollectionName"
},
"name": {
"S": "filename"
},
"path": {
"S": "CollectionName/filename%5Btag1%2Ctag2%2Casdasd%5D.jpg"
},
"soundUuid": {
"S": "1351028e-db98-4e19-a0b2-39125b7ac5d8"
},
"tags": {
"SS": [
"asdasd",
"tag1",
"tag2"
]
}
}
При выполнении функции почему-то получаю ошибку
ResourceNotFoundException: Requested resource not foundResourceNotFoundException: Requested resource not found