Encrypted Table Resource
High-level helper class to provide a familiar interface to encrypted tables.
- class dynamodb_encryption_sdk.encrypted.table.EncryptedTable(table: boto3.resources.base.ServiceResource, materials_provider: dynamodb_encryption_sdk.material_providers.CryptographicMaterialsProvider, table_info: Optional[dynamodb_encryption_sdk.structures.TableInfo] = None, attribute_actions: Optional[dynamodb_encryption_sdk.structures.AttributeActions] = None, auto_refresh_table_indexes: Optional[bool] = True)[source]
Bases:
object
High-level helper class to provide a familiar interface to encrypted tables.
>>> import boto3 >>> from dynamodb_encryption_sdk.encrypted.table import EncryptedTable >>> from dynamodb_encryption_sdk.material_providers.aws_kms import AwsKmsCryptographicMaterialsProvider >>> table = boto3.resource('dynamodb').Table('my_table') >>> aws_kms_cmp = AwsKmsCryptographicMaterialsProvider('alias/MyKmsAlias') >>> encrypted_table = EncryptedTable( ... table=table, ... materials_provider=aws_kms_cmp ... )
Note
This class provides a superset of the boto3 DynamoDB Table API, so should work as a drop-in replacement once configured.
If you want to provide per-request cryptographic details, the
put_item
,get_item
,query
, andscan
methods will also accept acrypto_config
parameter, defining a customCryptoConfig
instance for this request.Warning
We do not currently support the
update_item
method.- Parameters
table (boto3.resources.base.ServiceResource) – Pre-configured boto3 DynamoDB Table object
materials_provider (CryptographicMaterialsProvider) – Cryptographic materials provider to use
table_info (TableInfo) – Information about the target DynamoDB table
attribute_actions (AttributeActions) – Table-level configuration of how to encrypt/sign attributes
auto_refresh_table_indexes (bool) – Should we attempt to refresh information about table indexes? Requires
dynamodb:DescribeTable
permissions on each table. (default: True)