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

前端 未结 4 987
陌清茗
陌清茗 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:09

    You can use jq convert the json output given by aws cli to csv

    aws dynamodb scan --table-name mytable --query "Items[*].[id.S,name.S]" --output json | jq -r '.[] | @csv' > dump.csv
    

提交回复
热议问题