资源找不到查询DynamoDB
我正在尝试访问DynamoDB表,但是我一直在获得“未找到资源”错误。
该表的定义如下,请注意,该表是有效的,该区域是巴黎(EU-West-3)
我正在使用的代码:
export class EncuestaComponent implements OnInit {
[...]
client: DynamoDBClient = new DynamoDBClient({
region : 'eu-west-3',
credentials: {
accessKeyId: '[REDACTED]',
secretAccessKey: '[REDACTED]'
}
});
[...]
onDbClick() {
const commandParams = {};
const input: BatchExecuteStatementInput = {
Statements: [
{Statement: "SELECT opciones FROM encuesta.encuesta WHERE id = 'user.1'"}
],
}
const command = new BatchExecuteStatementCommand(input);
this.client.send(command).
then(data => console.log(data.Responses![0].Error)).
catch(error => {console.log("Error"); console.log(error)});
}
并且,在控制台中,它显示<< em> then 方法已执行,但是打印的消息是 {code:'resourcenotfound',message:'未找到请求资源'}
我在做什么错?
I am trying to access a DynamoDb table, but I keep getting a "Resource not found" error.
The table is defined as follows, note that the table is Active and the Region is Paris (eu-west-3)
The code I am using:
export class EncuestaComponent implements OnInit {
[...]
client: DynamoDBClient = new DynamoDBClient({
region : 'eu-west-3',
credentials: {
accessKeyId: '[REDACTED]',
secretAccessKey: '[REDACTED]'
}
});
[...]
onDbClick() {
const commandParams = {};
const input: BatchExecuteStatementInput = {
Statements: [
{Statement: "SELECT opciones FROM encuesta.encuesta WHERE id = 'user.1'"}
],
}
const command = new BatchExecuteStatementCommand(input);
this.client.send(command).
then(data => console.log(data.Responses![0].Error)).
catch(error => {console.log("Error"); console.log(error)});
}
And, in the console, it shows that the then method has been executed, but the message printed is {Code: 'ResourceNotFound', Message: 'Requested resource not found'}
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在DynamoDB的partiQl中,当您进行
时,从某种东西中选择 * *
表示您希望它查询表格上命名的else elese neshing something sometsing 。您要么需要做以下操作之一:我不在计算机前面,或者我会弄清楚它是为您的,但这是我开始的地方。
In PartiQL for DynamoDB, when you do
select * from something.else
means that you want it to query an index named else on table named something. Either you need to do one of the following:I am not in front of my computer or i would figure out which it is for you, but this is where I'd start.
这可能是引起问题的原因。
您可以确认
这里有一些可以帮助您测试功能的事情,请尝试在〜/.aws/凭据中添加密钥并运行此命令。
并确认它确实显示了表内容,并且没有获得访问拒绝的错误。
Here is something that might be causing the problem.
Can you confirm that
Here are a few things that can help you test out the functionality try adding the key in ~/.aws/credentials and running this command.
and confirm that it is indeed showing up the table content and not getting an access denied error.