Complete the code to enable point-in-time recovery on a DynamoDB table.
response = client.update_continuous_backups(
TableName='MyTable',
PointInTimeRecoverySpecification={
'PointInTimeRecoveryEnabled': [1]
}
)To enable PITR, set PointInTimeRecoveryEnabled to True.
Complete the code to get the status of point-in-time recovery for a DynamoDB table.
response = client.describe_continuous_backups(TableName=[1])The table name must be a string literal, so use quotes around it.
Fix the error in the code to restore a DynamoDB table to a specific point in time.
response = client.restore_table_to_point_in_time(
SourceTableName='MyTable',
TargetTableName='RestoredTable',
RestoreDateTime=[1]
)The RestoreDateTime parameter requires a datetime object, not a string.
Fill the blank to check if PITR is enabled and print the status.
status = response['ContinuousBackupsDescription']['[1]']\nprint(f\"PITR enabled: {status}\")
The PointInTimeRecoveryStatus under ContinuousBackupsDescription indicates if PITR is enabled ('ENABLED' or 'DISABLED').
Fill all three blanks to restore a DynamoDB table to a point in time with correct parameters.
response = client.restore_table_to_point_in_time(
SourceTableName=[1],
TargetTableName=[2],
RestoreDateTime=[3]
)Use string literals for source and target table names, and a datetime object for the restore time.