DynamoDB.Client.
delete_backup
(**kwargs)¶Deletes an existing backup of a table.
You can call DeleteBackup
at a maximum rate of 10 times per second.
See also: AWS API Documentation
Request Syntax
response = client.delete_backup(
BackupArn='string'
)
[REQUIRED]
The ARN associated with the backup.
{
'BackupDescription': {
'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)
},
'SourceTableDetails': {
'TableName': 'string',
'TableId': 'string',
'TableArn': 'string',
'TableSizeBytes': 123,
'KeySchema': [
{
'AttributeName': 'string',
'KeyType': 'HASH'|'RANGE'
},
],
'TableCreationDateTime': datetime(2015, 1, 1),
'ProvisionedThroughput': {
'ReadCapacityUnits': 123,
'WriteCapacityUnits': 123
},
'ItemCount': 123,
'BillingMode': 'PROVISIONED'|'PAY_PER_REQUEST'
},
'SourceTableFeatureDetails': {
'LocalSecondaryIndexes': [
{
'IndexName': 'string',
'KeySchema': [
{
'AttributeName': 'string',
'KeyType': 'HASH'|'RANGE'
},
],
'Projection': {
'ProjectionType': 'ALL'|'KEYS_ONLY'|'INCLUDE',
'NonKeyAttributes': [
'string',
]
}
},
],
'GlobalSecondaryIndexes': [
{
'IndexName': 'string',
'KeySchema': [
{
'AttributeName': 'string',
'KeyType': 'HASH'|'RANGE'
},
],
'Projection': {
'ProjectionType': 'ALL'|'KEYS_ONLY'|'INCLUDE',
'NonKeyAttributes': [
'string',
]
},
'ProvisionedThroughput': {
'ReadCapacityUnits': 123,
'WriteCapacityUnits': 123
}
},
],
'StreamDescription': {
'StreamEnabled': True|False,
'StreamViewType': 'NEW_IMAGE'|'OLD_IMAGE'|'NEW_AND_OLD_IMAGES'|'KEYS_ONLY'
},
'TimeToLiveDescription': {
'TimeToLiveStatus': 'ENABLING'|'DISABLING'|'ENABLED'|'DISABLED',
'AttributeName': 'string'
},
'SSEDescription': {
'Status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'UPDATING',
'SSEType': 'AES256'|'KMS',
'KMSMasterKeyArn': 'string',
'InaccessibleEncryptionDateTime': datetime(2015, 1, 1)
}
}
}
}
Response Structure
Contains the description of the backup created for the table.
Contains the details of the backup created for the table.
ARN associated with the backup.
Name of the requested backup.
Size of the backup in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.
Backup can be in one of the following states: CREATING, ACTIVE, DELETED.
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.Time at which the backup was created. This is the request time of the backup.
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.
Contains the details of the table when the backup was created.
The name of the table for which the backup was created.
Unique identifier for the table for which the backup was created.
ARN of the table for which backup was created.
Size of the table in bytes. Note that this is an approximate value.
Schema of the table.
Represents a single element of a key schema. A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.
A KeySchemaElement
represents exactly one attribute of the primary key. For example, a simple primary key would be represented by one KeySchemaElement
(for the partition key). A composite primary key would require one KeySchemaElement
for the partition key, and another KeySchemaElement
for the sort key.
A KeySchemaElement
must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.
The name of a key attribute.
The role that this key attribute will assume:
HASH
- partition keyRANGE
- sort keyNote
The partition key of an item is also known as its hash attribute . The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
Time when the source table was created.
Read IOPs and Write IOPS on the table when the backup was created.
The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException
. For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB Developer Guide .
If read/write capacity mode is PAY_PER_REQUEST
the value is set to 0.
The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException
. For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB Developer Guide .
If read/write capacity mode is PAY_PER_REQUEST
the value is set to 0.
Number of items in the table. Note that this is an approximate value.
Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.
PROVISIONED
- Sets the read/write capacity mode to PROVISIONED
. We recommend using PROVISIONED
for predictable workloads.PAY_PER_REQUEST
- Sets the read/write capacity mode to PAY_PER_REQUEST
. We recommend using PAY_PER_REQUEST
for unpredictable workloads.Contains the details of the features enabled on the table when the backup was created. For example, LSIs, GSIs, streams, TTL.
Represents the LSI properties for the table when the backup was created. It includes the IndexName, KeySchema and Projection for the LSIs on the table at the time of backup.
Represents the properties of a local secondary index for the table when the backup was created.
Represents the name of the local secondary index.
The complete key schema for a local secondary index, which consists of one or more pairs of attribute names and key types:
HASH
- partition keyRANGE
- sort keyNote
The partition key of an item is also known as its hash attribute . The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
Represents a single element of a key schema. A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.
A KeySchemaElement
represents exactly one attribute of the primary key. For example, a simple primary key would be represented by one KeySchemaElement
(for the partition key). A composite primary key would require one KeySchemaElement
for the partition key, and another KeySchemaElement
for the sort key.
A KeySchemaElement
must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.
The name of a key attribute.
The role that this key attribute will assume:
HASH
- partition keyRANGE
- sort keyNote
The partition key of an item is also known as its hash attribute . The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
Represents attributes that are copied (projected) from the table into the global secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.
The set of attributes that are projected into the index:
KEYS_ONLY
- Only the index and primary keys are projected into the index.INCLUDE
- In addition to the attributes described in KEYS_ONLY
, the secondary index will include other non-key attributes that you specify.ALL
- All of the table attributes are projected into the index.Represents the non-key attribute names which will be projected into the index.
For local secondary indexes, the total count of NonKeyAttributes
summed across all of the local secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
Represents the GSI properties for the table when the backup was created. It includes the IndexName, KeySchema, Projection, and ProvisionedThroughput for the GSIs on the table at the time of backup.
Represents the properties of a global secondary index for the table when the backup was created.
The name of the global secondary index.
The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types:
HASH
- partition keyRANGE
- sort keyNote
The partition key of an item is also known as its hash attribute . The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
Represents a single element of a key schema. A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.
A KeySchemaElement
represents exactly one attribute of the primary key. For example, a simple primary key would be represented by one KeySchemaElement
(for the partition key). A composite primary key would require one KeySchemaElement
for the partition key, and another KeySchemaElement
for the sort key.
A KeySchemaElement
must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.
The name of a key attribute.
The role that this key attribute will assume:
HASH
- partition keyRANGE
- sort keyNote
The partition key of an item is also known as its hash attribute . The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
Represents attributes that are copied (projected) from the table into the global secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.
The set of attributes that are projected into the index:
KEYS_ONLY
- Only the index and primary keys are projected into the index.INCLUDE
- In addition to the attributes described in KEYS_ONLY
, the secondary index will include other non-key attributes that you specify.ALL
- All of the table attributes are projected into the index.Represents the non-key attribute names which will be projected into the index.
For local secondary indexes, the total count of NonKeyAttributes
summed across all of the local secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
Represents the provisioned throughput settings for the specified global secondary index.
The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException
. For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB Developer Guide .
If read/write capacity mode is PAY_PER_REQUEST
the value is set to 0.
The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException
. For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB Developer Guide .
If read/write capacity mode is PAY_PER_REQUEST
the value is set to 0.
Stream settings on the table when the backup was created.
Indicates whether DynamoDB Streams is enabled (true) or disabled (false) on the table.
When an item in the table is modified, StreamViewType
determines what information is written to the stream for this table. Valid values for StreamViewType
are:
KEYS_ONLY
- Only the key attributes of the modified item are written to the stream.NEW_IMAGE
- The entire item, as it appears after it was modified, is written to the stream.OLD_IMAGE
- The entire item, as it appeared before it was modified, is written to the stream.NEW_AND_OLD_IMAGES
- Both the new and the old item images of the item are written to the stream.Time to Live settings on the table when the backup was created.
The TTL status for the table.
The name of the TTL attribute for items in the table.
The description of the server-side encryption status on the table when the backup was created.
Represents the current state of server-side encryption. The only supported values are:
ENABLED
- Server-side encryption is enabled.UPDATING
- Server-side encryption is being updated.Server-side encryption type. The only supported value is:
KMS
- Server-side encryption that uses Key Management Service. The key is stored in your account and is managed by KMS (KMS charges apply).The KMS key ARN used for the KMS encryption.
Indicates the time, in UNIX epoch date format, when DynamoDB detected that the table's KMS key was inaccessible. This attribute will automatically be cleared when DynamoDB detects that the table's KMS key is accessible again. DynamoDB will initiate the table archival process when table's KMS key remains inaccessible for more than seven days from this date.
Exceptions
DynamoDB.Client.exceptions.BackupNotFoundException
DynamoDB.Client.exceptions.BackupInUseException
DynamoDB.Client.exceptions.LimitExceededException
DynamoDB.Client.exceptions.InternalServerError