0
0
DynamoDBquery~5 mins

Export to S3 in DynamoDB

Choose your learning style9 modes available
Introduction

Exporting to S3 lets you save your DynamoDB table data as files in Amazon S3. This helps you back up data or use it in other tools easily.

You want to back up your DynamoDB table data regularly.
You need to analyze your DynamoDB data using tools that read files from S3.
You want to move data from DynamoDB to another system that reads from S3.
You want to archive old data from DynamoDB for long-term storage.
You want to share DynamoDB data with other teams using S3 access.
Syntax
DynamoDB
aws dynamodb export-table-to-point-in-time \
  --table-arn <table-arn> \
  --s3-bucket <bucket-name> \
  --export-format DYNAMODB_JSON|ION|CSV \
  [--export-time <timestamp>] \
  [--s3-prefix <prefix>]

The --table-arn is the full Amazon Resource Name of your DynamoDB table.

You can choose the export format as DYNAMODB_JSON, ION, or CSV depending on your needs.

Examples
Exports the entire 'Books' table to the S3 bucket 'my-dynamodb-exports' in DynamoDB JSON format.
DynamoDB
aws dynamodb export-table-to-point-in-time \
  --table-arn arn:aws:dynamodb:us-west-2:123456789012:table/Books \
  --s3-bucket my-dynamodb-exports \
  --export-format DYNAMODB_JSON
Exports the 'Orders' table as it was at noon on June 1, 2024, to the 'order-exports' bucket under the 'june-exports/' folder in CSV format.
DynamoDB
aws dynamodb export-table-to-point-in-time \
  --table-arn arn:aws:dynamodb:us-west-2:123456789012:table/Orders \
  --s3-bucket order-exports \
  --export-format CSV \
  --export-time 2024-06-01T12:00:00Z \
  --s3-prefix june-exports/
Sample Program

This command exports the current data from the 'Employees' table to the S3 bucket 'my-employee-backups' in Ion format, placing files under the 'backups/2024-06-15/' folder.

DynamoDB
aws dynamodb export-table-to-point-in-time \
  --table-arn arn:aws:dynamodb:us-west-2:123456789012:table/Employees \
  --s3-bucket my-employee-backups \
  --export-format ION \
  --s3-prefix backups/2024-06-15/
OutputSuccess
Important Notes

Exporting can take some time depending on table size.

You need proper permissions for both DynamoDB and S3 to export data.

Exports are read-only snapshots and do not affect your live table.

Summary

Export to S3 saves DynamoDB data as files for backup or analysis.

You specify the table, S3 bucket, and format when exporting.

Exports create snapshots without changing your live data.