0
0
DynamoDBquery~10 mins

Point-in-time recovery (PITR) in DynamoDB - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable point-in-time recovery on a DynamoDB table.

DynamoDB
response = client.update_continuous_backups(
    TableName='MyTable',
    PointInTimeRecoverySpecification={
        'PointInTimeRecoveryEnabled': [1]
    }
)
Drag options to blanks, or click blank then click option'
ATrue
BFalse
C'Enabled'
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string like 'True' instead of the boolean True.
Setting the value to False which disables PITR.
2fill in blank
medium

Complete the code to get the status of point-in-time recovery for a DynamoDB table.

DynamoDB
response = client.describe_continuous_backups(TableName=[1])
Drag options to blanks, or click blank then click option'
AMyTable
B'MyTable'
C"MyTable"
Dtable_name
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the table name without quotes causing a syntax error.
Using a variable name without defining it.
3fill in blank
hard

Fix the error in the code to restore a DynamoDB table to a specific point in time.

DynamoDB
response = client.restore_table_to_point_in_time(
    SourceTableName='MyTable',
    TargetTableName='RestoredTable',
    RestoreDateTime=[1]
)
Drag options to blanks, or click blank then click option'
A"2023-01-01 12:00:00"
B'2023-01-01T12:00:00Z'
C2023-01-01 12:00:00
Ddatetime.datetime(2023, 1, 1, 12, 0, 0)
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a string instead of a datetime object.
Using an incorrect datetime string format.
4fill in blank
hard

Fill the blank to check if PITR is enabled and print the status.

DynamoDB
status = response['ContinuousBackupsDescription']['[1]']\nprint(f\"PITR enabled: {status}\")
Drag options to blanks, or click blank then click option'
APointInTimeRecoveryStatus
BPointInTimeRecoveryEnabled
CContinuousBackupsStatus
DBackupEnabled
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect keys that do not exist in the response.
Mixing up status and enabled keys.
5fill in blank
hard

Fill all three blanks to restore a DynamoDB table to a point in time with correct parameters.

DynamoDB
response = client.restore_table_to_point_in_time(
    SourceTableName=[1],
    TargetTableName=[2],
    RestoreDateTime=[3]
)
Drag options to blanks, or click blank then click option'
A'OriginalTable'
B'RestoredTable'
Cdatetime.datetime(2024, 6, 1, 15, 30, 0)
D'BackupTable'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing table names without quotes.
Passing RestoreDateTime as a string.