[英]How to fetch all items from dynamo db without scan in lambda function
I'm trying to fetch all items from dynamoDB table, But issue is administrator has not added permission of Scan in roles assigned to me, is there any alternative to scan method, I looked into aws wrangler library but aws wrangler does not have any method for get items.我正在尝试从 dynamoDB 表中获取所有项目,但问题是管理员没有在分配给我的角色中添加扫描权限,是否有任何替代扫描方法的方法,我查看了aws wrangler 库,但 aws wrangler 没有任何方法获取物品。 Error I got when I run
table.scan()
:运行
table.scan()
时出现错误:
An error occurred (AccessDeniedException) when calling the scan operation: User: arn:aws:sts::xxxxx:assumed-role. xxxxxxxx/xxxxx-lambdafunction is not authorized to perform: dynamodb:Scan
As table contain 1000s of data so I need to use pagination, so is there any alternate of scan or any way around using aws wrangelr to fetch all tables data由于表包含 1000 条数据,所以我需要使用分页,所以是否有任何替代扫描或使用 aws wrangelr 获取所有表数据的任何方法
I would suggest that you talk with your administrator and provide the reason why you need Scan, you may be breaking company policy.我建议您与您的管理员交谈并提供您需要扫描的原因,您可能违反了公司政策。
You can use PartiQL ExecuteStatement API which will fetch all of the data in the table.您可以使用 PartiQL ExecuteStatement API,它将获取表中的所有数据。 But again, I advise you talk with your admin.
但同样,我建议您与您的管理员交谈。
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ExecuteStatement.html https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ExecuteStatement.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.