I want to use point-in-time recovery for Amazon DynamoDB, but I don't know how to turn it on.
Short description
To turn on point-in-time recovery (PITR) for your DynamoDB instance, use one of the following methods:
- DynamoDB console
- AWS Command Line Interface (AWS CLI)
- AWS CloudFormation
- DynamoDB API
Note: DynamoDB charges for PITR based on the size of each DynamoDB table, including table data and local secondary indexes. To determine your backup charges, DynamoDB continuously monitors the size of the tables that have PITR turned on. You're billed for PITR usage until you turn off PITR for each table.
Resolution
DynamoDB console
Complete the following steps:
- Open the DynamoDB console.
- In the navigation pane, choose Tables, and then select your table.
- Under Backups, for the Point-in-time recovery (PITR) option, choose Edit.
- Select Turn on point-in-time recovery, and then choose Save changes.
AWS CLI
Note: If you receive errors when you run AWS CLI commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.
Run the update-continuous-backups command with the point-in-time-recovery-specification setting turned on:
aws dynamodb update-continuous-backups \
--table-name <table-name>\
--point-in-time-recovery-specification PointInTimeRecoveryEnabled=true
CloudFormation
Use the AWS::DynamoDB::Table resource with the PointInTimeRecoverySpecification property turned on:
Resources:
iotCatalog:
Type: AWS::DynamoDB::Table
Properties:
...
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: true
DynamoDB API
Run the UpdateContinuousBackups API operation with the PointInTimeRecoverySpecification parameter turned on.
Request syntax example:
{
"PointInTimeRecoverySpecification": {
"PointInTimeRecoveryEnabled": boolean
},
"TableName": "string"
}
Response syntax example:
{
"ContinuousBackupsDescription": {
"ContinuousBackupsStatus": "string",
"PointInTimeRecoveryDescription": {
"EarliestRestorableDateTime": number,
"LatestRestorableDateTime": number,
"PointInTimeRecoveryStatus": "string"
}
}
}
Related information
Restoring a table using point-in-time recovery