DynamoDB / Client / create_backup

create_backup#

DynamoDB.Client.create_backup(**kwargs)#

Creates a backup for an existing table.

Each time you create an on-demand backup, the entire table data is backed up. There is no limit to the number of on-demand backups that can be taken.

When you create an on-demand backup, a time marker of the request is cataloged, and the backup is created asynchronously, by applying all changes until the time of the request to the last full table snapshot. Backup requests are processed instantaneously and become available for restore within minutes.

You can call CreateBackup at a maximum rate of 50 times per second.

All backups in DynamoDB work without consuming any provisioned throughput on the table.

If you submit a backup request on 2018-12-14 at 14:25:00, the backup is guaranteed to contain all data committed to the table up to 14:24:00, and data committed after 14:26:00 will not be. The backup might contain data modifications made between 14:24:00 and 14:26:00. On-demand backup does not support causal consistency.

Along with data, the following are also included on the backups:

  • Global secondary indexes (GSIs)

  • Local secondary indexes (LSIs)

  • Streams

  • Provisioned read and write capacity

See also: AWS API Documentation

Request Syntax

response = client.create_backup(
    TableName='string',
    BackupName='string'
)
Parameters:
  • TableName (string) –

    [REQUIRED]

    The name of the table.

  • BackupName (string) –

    [REQUIRED]

    Specified name for the backup.

Return type:

dict

Returns:

Response Syntax

{
    'BackupDetails': {
        'BackupArn': 'string',
        'BackupName': 'string',
        'BackupSizeBytes': 123,
        'BackupStatus': 'CREATING'|'DELETED'|'AVAILABLE',
        'BackupType': 'USER'|'SYSTEM'|'AWS_BACKUP',
        'BackupCreationDateTime': datetime(2015, 1, 1),
        'BackupExpiryDateTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) –

    • BackupDetails (dict) –

      Contains the details of the backup created for the table.

      • BackupArn (string) –

        ARN associated with the backup.

      • BackupName (string) –

        Name of the requested backup.

      • BackupSizeBytes (integer) –

        Size of the backup in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.

      • BackupStatus (string) –

        Backup can be in one of the following states: CREATING, ACTIVE, DELETED.

      • BackupType (string) –

        BackupType:

        • USER - You create and manage these using the on-demand backup feature.

        • SYSTEM - If you delete a table with point-in-time recovery enabled, a SYSTEM backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.

        • AWS_BACKUP - On-demand backup created by you from Backup service.

      • BackupCreationDateTime (datetime) –

        Time at which the backup was created. This is the request time of the backup.

      • BackupExpiryDateTime (datetime) –

        Time at which the automatic on-demand backup created by DynamoDB will expire. This SYSTEM on-demand backup expires automatically 35 days after its creation.

Exceptions

  • DynamoDB.Client.exceptions.TableNotFoundException

  • DynamoDB.Client.exceptions.TableInUseException

  • DynamoDB.Client.exceptions.ContinuousBackupsUnavailableException

  • DynamoDB.Client.exceptions.BackupInUseException

  • DynamoDB.Client.exceptions.LimitExceededException

  • DynamoDB.Client.exceptions.InternalServerError