@pepperize/cdk-dynamodb-backup
v0.0.484
Published
Backup and restore AWS DynamoDB Table to AWS S3 Bucket with AWS Data Pipeline.
Downloads
755
Readme
CDK DynamoDB Backup & Restore
Backup and restore AWS DynamoDB Table with AWS Data Pipeline.
Install
TypeScript
npm install @pepperize/cdk-dynamodb-backup
or
yarn add @pepperize/cdk-dynamodb-backup
Python
pip install pepperize.cdk-dynamodb-backup
C# / .Net
dotnet add package Pepperize.CDK.DynamodbBackup
Java
<dependency>
<groupId>com.pepperize</groupId>
<artifactId>cdk-dynamodb-backup</artifactId>
<version>${cdkDynamodbBackup.version}</version>
</dependency>
Usage
See API.md.
Backup
Export data from AWS DynamoDB to AWS S3
const table = new aws_dynamodb.Table(stack, "Table", {
partitionKey: { name: "id", type: dynamodb.AttributeType.STRING },
});
const bucket = new aws_s3.Bucket(stack, "Bucket", {});
// When
new DataPipelineBackup(stack, "Account", {
table: table,
backupBucket: bucket,
});
See Exporting Data From DynamoDB to Amazon S3
Restore
Import data from AWS S3 into AWS DynamoDB
const table = new aws_dynamodb.Table(stack, "Table", {
partitionKey: { name: "id", type: dynamodb.AttributeType.STRING },
});
const bucket = new aws_s3.Bucket(stack, "Bucket", {});
// When
new DataPipelineRestore(stack, "Restore", {
table: table,
restoreBucket: bucket,
restoreFolder: "/prefix/to/folder/with/manifest",
});