How to export a dynamodb table as a csv through aws-cli ( without using pipeline)

前端 未结 4 996
陌清茗
陌清茗 2020-12-13 09:51

I am new to aws-cli and I am trying to export my dynamodb table as a csv so that i can import it directly into postgresql. Is there a way to do that using aws-cli ?

4条回答
  •  情深已故
    2020-12-13 10:18

    A better way to do a full export of all columns without listign out is at Dynamo db export to csv

    basically

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

提交回复
热议问题