- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateContinuousBackupsCommand
UpdateContinuousBackups
enables or disables point in time recovery for the specified table. A successful UpdateContinuousBackups
call returns the current ContinuousBackupsDescription
. Continuous backups are ENABLED
on all tables at table creation. If point in time recovery is enabled, PointInTimeRecoveryStatus
will be set to ENABLED.
Once continuous backups and point in time recovery are enabled, you can restore to any point in time within EarliestRestorableDateTime
and LatestRestorableDateTime
.
LatestRestorableDateTime
is typically 5 minutes before the current time. You can restore your table to any point in time in the last 35 days. You can set the RecoveryPeriodInDays
to any value between 1 and 35 days.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DynamoDBClient, UpdateContinuousBackupsCommand } from "@aws-sdk/client-dynamodb"; // ES Modules import
// const { DynamoDBClient, UpdateContinuousBackupsCommand } = require("@aws-sdk/client-dynamodb"); // CommonJS import
const client = new DynamoDBClient(config);
const input = { // UpdateContinuousBackupsInput
TableName: "STRING_VALUE", // required
PointInTimeRecoverySpecification: { // PointInTimeRecoverySpecification
PointInTimeRecoveryEnabled: true || false, // required
RecoveryPeriodInDays: Number("int"),
},
};
const command = new UpdateContinuousBackupsCommand(input);
const response = await client.send(command);
// { // UpdateContinuousBackupsOutput
// ContinuousBackupsDescription: { // ContinuousBackupsDescription
// ContinuousBackupsStatus: "ENABLED" || "DISABLED", // required
// PointInTimeRecoveryDescription: { // PointInTimeRecoveryDescription
// PointInTimeRecoveryStatus: "ENABLED" || "DISABLED",
// RecoveryPeriodInDays: Number("int"),
// EarliestRestorableDateTime: new Date("TIMESTAMP"),
// LatestRestorableDateTime: new Date("TIMESTAMP"),
// },
// },
// };
UpdateContinuousBackupsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
PointInTimeRecoverySpecification Required | PointInTimeRecoverySpecification | undefined | Represents the settings used to enable point in time recovery. |
TableName Required | string | undefined | The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter. |
UpdateContinuousBackupsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ContinuousBackupsDescription | ContinuousBackupsDescription | undefined | Represents the continuous backups and point in time recovery settings on the table. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ContinuousBackupsUnavailableException | client | Backups have not yet been enabled for this table. |
InternalServerError | server | An error occurred on the server side. |
InvalidEndpointException | client | |
TableNotFoundException | client | A source table with the name |
DynamoDBServiceException | Base exception class for all service exceptions from DynamoDB service. |