In need of exporting dynamodb table into csv

0

Hi,

I want to automate the csv exporting so my team can access the csv file which i would store into an S3 bukkit. I find many solutions about how to import csv files into dynamo but none of them are giving me the answer for exporting to csv. I know there is a "export to csv" button in dynamodb and that's exactly how i want it but then automated. I've been trying with lambda , glue , Exports and streams ,... None of them seem to work or getting stuck because can't find any good documentation. Can somebody pleas help me out?

Thanks

1 Risposta
6

One such way to do it programmatically is doing a Scan operation and formatting the data to CSV:

   aws dynamodb scan \
  --table-name <table_name> \
  --select ALL_ATTRIBUTES \
  --page-size 500 \
  --max-items 10000 \
  --output json | jq -r '.Items' | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ][]?])[] | @csv' > my-table-3.csv

Another way is using AWS Datapipeline to export the table to CSV and stores it directly on S3:

https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-template-exportddbtos3.html


And finally you can use AWS Glue to read the DynamoDB table and write to S3 in CSV format:

https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-format-csv-home.html#aws-glue-programming-etl-format-csv-write


There is also third party options available, many of which you must pay for such as DynoBase:

https://dynobase.dev/export-dynamodb-to-csv/

profile pictureAWS
ESPERTO
con risposta un anno fa
profile pictureAWS
ESPERTO
verificato un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande