Importing from S3 lets you quickly add lots of data into your DynamoDB table from files stored in Amazon S3. It saves time and effort compared to adding items one by one.
Import from S3 in DynamoDB
aws dynamodb import-table --s3-bucket-source S3Bucket=<bucket>,S3KeyPrefix=<prefix> --input-format <format> --table-name <table-name> [--client-token <token>]
--input-format specifies the file format like DYNAMODB_JSON or ION.
--s3-bucket-source specifies the S3 bucket and key prefix of your data files.
aws dynamodb import-table --input-format DYNAMODB_JSON --s3-bucket-source S3Bucket=mybucket,S3KeyPrefix=data/ --table-name Customers
aws dynamodb import-table --input-format DYNAMODB_JSON --s3-bucket-source S3Bucket=mybucket,S3KeyPrefix=backup/ --table-name Orders
This command starts importing data from DynamoDB JSON files stored in the S3 bucket 'example-bucket' under the prefix 'sample-data/' into the DynamoDB table named 'SampleTable'.
aws dynamodb import-table --input-format DYNAMODB_JSON --s3-bucket-source S3Bucket=example-bucket,S3KeyPrefix=sample-data/ --table-name SampleTable
Make sure your IAM user or role has permission to read from the S3 bucket and write to the DynamoDB table.
The import process runs asynchronously; you can check the status using AWS CLI or Console.
Supported input formats include DYNAMODB_JSON and ION.
Importing from S3 helps load large data sets into DynamoDB quickly.
You specify the S3 location and file format to start the import.
Permissions and correct file format are important for a successful import.