简体   繁体   中英

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. Error I got when I run 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

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. But again, I advise you talk with your admin.

https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ExecuteStatement.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM