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

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

    For localhost dynamodb:

    $aws dynamodb scan --table-name AOP --region us-east-1 --endpoint-url
    http://localhost:8000 --output json > /home/ohelig/Desktop/a.json
    

    For dynamodb:

    $aws dynamodb scan --table-name AOP --region us-east-1 --output json > /home/ohelig/Desktop/a.json
    

    Then Convert JSON to CSV or whatever.

    I have modified above answer to make it clear.

提交回复
热议问题