@@ -55,7 +55,7 @@ def create_legacy_encrypted_client(attribute_actions=None, expect_standard_dicti
55
55
"""Create a legacy DynamoDB encrypted client."""
56
56
cmp = AwsKmsCryptographicMaterialsProvider (key_id = INTEG_TEST_DEFAULT_KMS_KEY_ID )
57
57
return LegacyEncryptedClient (
58
- client = boto3 . client ( "dynamodb" ),
58
+ client = plaintext_client ( expect_standard_dictionaries ),
59
59
materials_provider = cmp ,
60
60
attribute_actions = attribute_actions ,
61
61
expect_standard_dictionaries = expect_standard_dictionaries ,
@@ -124,6 +124,14 @@ def create_encryption_config(legacy_encryptor=None, legacy_policy=None):
124
124
return DynamoDbTablesEncryptionConfig (table_encryption_configs = table_configs )
125
125
126
126
127
+ def plaintext_client (expect_standard_dictionaries ):
128
+ if expect_standard_dictionaries :
129
+ client = boto3 .resource ("dynamodb" ).Table (INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME ).meta .client
130
+ else :
131
+ client = boto3 .client ("dynamodb" )
132
+ return client
133
+
134
+
127
135
def encrypted_client_with_legacy_override (
128
136
legacy_encryptor = None , legacy_policy = None , expect_standard_dictionaries = False
129
137
):
@@ -132,7 +140,7 @@ def encrypted_client_with_legacy_override(
132
140
133
141
# Create the EncryptedClient
134
142
return EncryptedClient (
135
- client = boto3 . client ( "dynamodb" ),
143
+ client = plaintext_client ( expect_standard_dictionaries ),
136
144
encryption_config = tables_config ,
137
145
expect_standard_dictionaries = expect_standard_dictionaries ,
138
146
)
@@ -159,17 +167,3 @@ def encrypted_resource_with_legacy_override(legacy_encryptor=None, legacy_policy
159
167
resource = boto3 .resource ("dynamodb" ),
160
168
encryption_config = tables_config ,
161
169
)
162
-
163
-
164
- def cleanup_ddb_items (items ):
165
- """Delete DynamoDB items from the test table."""
166
- client = boto3 .client ("dynamodb" )
167
- for item in items :
168
- try :
169
- client .delete_item (
170
- TableName = INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME ,
171
- Key = {"partition_key" : item ["partition_key" ], "sort_key" : item ["sort_key" ]},
172
- )
173
- except Exception :
174
- # Ignore errors on cleanup
175
- pass
0 commit comments