aws_dbesdk_dynamodb.encrypted.resource
High-level helper classes to provide encrypting wrappers for boto3 DynamoDB resources.
Classes
|
Wrapper for a boto3 DynamoDB resource. |
|
Collection manager that yields EncryptedTable objects. |
- class aws_dbesdk_dynamodb.encrypted.resource.EncryptedTablesCollectionManager(*, collection: CollectionManager, encryption_config: DynamoDbTablesEncryptionConfig)
Bases:
EncryptedBotoInterfaceCollection manager that yields EncryptedTable objects.
The API matches boto3’s tables collection manager interface:
All operations on this class will yield
EncryptedTableobjects.Create an
EncryptedTablesCollectionManagerobject.- Parameters:
collection (CollectionManager) – Pre-configured boto3 DynamoDB table collection manager
encryption_config (DynamoDbTablesEncryptionConfig) – Initialized DynamoDbTablesEncryptionConfig
- __init__(*, collection: CollectionManager, encryption_config: DynamoDbTablesEncryptionConfig)
Create an
EncryptedTablesCollectionManagerobject.- Parameters:
collection (CollectionManager) – Pre-configured boto3 DynamoDB table collection manager
encryption_config (DynamoDbTablesEncryptionConfig) – Initialized DynamoDbTablesEncryptionConfig
- all() Generator[EncryptedTable, None, None]
Create an iterable of all EncryptedTable resources in the collection.
- Returns:
An iterable of EncryptedTable objects
- Return type:
Generator[EncryptedTable, None, None]
- filter(**kwargs) Generator[EncryptedTable, None, None]
Create an iterable of all EncryptedTable resources in the collection filtered by kwargs passed to method.
- Returns:
An iterable of EncryptedTable objects
- Return type:
Generator[EncryptedTable, None, None]
- limit(**kwargs) Generator[EncryptedTable, None, None]
Create an iterable of all EncryptedTable resources in the collection filtered by kwargs passed to method.
- Returns:
An iterable of EncryptedTable objects
- Return type:
Generator[EncryptedTable, None, None]
- page_size(**kwargs) Generator[EncryptedTable, None, None]
Create an iterable of all EncryptedTable resources in the collection.
This limits the number of items returned by each service call by the specified amount.
- Returns:
An iterable of EncryptedTable objects
- Return type:
Generator[EncryptedTable, None, None]
- class aws_dbesdk_dynamodb.encrypted.resource.EncryptedResource(*, resource: ServiceResource, encryption_config: DynamoDbTablesEncryptionConfig)
Bases:
EncryptedBotoInterfaceWrapper for a boto3 DynamoDB resource.
This class implements the complete boto3 DynamoDB resource API, allowing it to serve as a drop-in replacement that transparently handles encryption and decryption of items.
The API matches the standard boto3 DynamoDB resource interface:
This class will encrypt/decrypt items for the following operations:
batch_get_itembatch_write_item
Calling
Table()will return anEncryptedTableobject.Any other operations on this class will defer to the underlying boto3 DynamoDB resource’s implementation and will not be encrypted/decrypted.
Create an
EncryptedResourceobject.- Parameters:
resource (ServiceResource) – Initialized boto3 DynamoDB resource
encryption_config (DynamoDbTablesEncryptionConfig) – Initialized DynamoDbTablesEncryptionConfig
- __init__(*, resource: ServiceResource, encryption_config: DynamoDbTablesEncryptionConfig)
Create an
EncryptedResourceobject.- Parameters:
resource (ServiceResource) – Initialized boto3 DynamoDB resource
encryption_config (DynamoDbTablesEncryptionConfig) – Initialized DynamoDbTablesEncryptionConfig
- Table(name)
Create an
EncryptedTableresource.- Parameters:
name (str) – The EncryptedTable’s name identifier. This must be set.
- Returns:
An
EncryptedTableresource- Return type:
- batch_get_item(**kwargs)
Get multiple items from one or more tables. Decrypts any returned items.
The input and output syntaxes match those for the boto3 DynamoDB resource
batch_get_itemAPI:- Parameters:
**kwargs – Keyword arguments to pass to the operation. These match the boto3 resource
batch_get_itemrequest syntax.- Returns:
The response from DynamoDB. This matches the boto3 resource
batch_get_itemresponse syntax. The"Responses"field will be decrypted locally after being read from DynamoDB.- Return type:
- batch_write_item(**kwargs)
Put or delete multiple items in one or more tables.
For put operations, encrypts items before writing.
The input and output syntaxes match those for the boto3 DynamoDB resource
batch_write_itemAPI:- Parameters:
**kwargs – Keyword arguments to pass to the operation. These match the boto3 resource
batch_write_itemrequest syntax. Any"PutRequest"values in the"RequestItems"argument will be encrypted locally before being written to DynamoDB.- Returns:
The response from DynamoDB. This matches the boto3 resource
batch_write_itemresponse syntax.- Return type: