我在 dynamodb 表上有一个数据集,我有一个脚本来填充这个表。在本地我可以使用
与它交互const credentials = new AWS.SharedIniFileCredentials({profile: 'myProfile'})
但是当我尝试使用这种方法与数据库交互时,我有了 lambda 速率函数:
AWS.config.update({
region: "us-east-1", // your AWS region
accessKeyId: 'KEY',
secretAccessKey: 'key/key'
});
我从标题中得到错误:
The request signature we calculated does not match the signature you provided
虽然
accessKeyId
和secretAccessKey
是一样的。
方法示例:
const queryTokens = async () => {
try {
const params = {
TableName: "brc-20",
};
const command = new ScanCommand(params);
const response = await client.send(command);
return response.Items;
} catch (error) {
console.log(error.message, 'for queryTokens');
}
};