title: Export | Import DynamoDB only with AWS CLI
body: <p>My goal is to have simple tool for export dynamodb to local file(json/csv) only with <code>aws cli</code> or less 3th party as it's possible. The size of my tables are around 500mb.</p>
  <p>I'm doing the research for few days now and I saw very nice projects like <code>dynamodump</code> and another SDK implementations. Also I test the <code>Datapipeline</code> from Amazon, but for task that I'm targeting want simple <code>aws cli</code>.</p>
  <p>Let's say that I already have map for the table such as indexs and attributes.Now I want to import just the Items that I have. For me the best solution for the implementation that I have will be something like this:</p>
  <ol>
  <li><p>Exporting the table from aws to local file:
  <code>aws dynamodb scan --table-name SOMETABLENAME  --output json |  jq '.Items[]' &gt; SOMETABLENAME.json</code></p>
  </li>
  <li><p>Rendering the file with things like <code>sed</code>, <code>jq</code>, <code>awk</code> ...etc. To get proper json format whom can be imported to aws-dynamodb</p>
  </li>
  <li><p>Import the Items from SOMETABLENAME to aws-dynamodb with:</p>
  <p><code>aws dynamodb put-item --table-name SOMETABLENAME --item file://SOMETABLENAME.json</code></p>
  </li>
  </ol>