File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Examples/runtimes/python/DynamoDBEncryption
src/basic_put_get_example
test/basic_put_get_example Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ def encrypted_table_put_get_example(
110
110
table_configs [dynamodb_table_name ] = table_config
111
111
tables_config = DynamoDbTablesEncryptionConfig (table_encryption_configs = table_configs )
112
112
113
- # 5. Create the EncryptedClient
113
+ # 5. Create the EncryptedTable
114
114
encrypted_table = EncryptedTable (
115
115
table = boto3 .resource ("dynamodb" ).Table (dynamodb_table_name ),
116
116
encryption_config = tables_config ,
@@ -128,7 +128,6 @@ def encrypted_table_put_get_example(
128
128
}
129
129
130
130
put_item_request = {
131
- "TableName" : dynamodb_table_name ,
132
131
"Item" : item_to_encrypt ,
133
132
}
134
133
@@ -142,7 +141,7 @@ def encrypted_table_put_get_example(
142
141
# back the original item.
143
142
key_to_get = {"partition_key" : "BasicPutGetExample" , "sort_key" : 0 }
144
143
145
- get_item_request = {"TableName" : dynamodb_table_name , " Key" : key_to_get }
144
+ get_item_request = {"Key" : key_to_get }
146
145
147
146
get_item_response = encrypted_table .get_item (** get_item_request )
148
147
Original file line number Diff line number Diff line change 1
1
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2
2
# SPDX-License-Identifier: Apache-2.0
3
- """Test suite for the EncryptedClient example."""
3
+ """Test suite for the EncryptedTable example."""
4
4
import pytest
5
5
6
6
from ...src .basic_put_get_example .with_encrypted_table import encrypted_table_put_get_example
9
9
10
10
11
11
def test_encrypted_table_put_get_example ():
12
- """Test function for encrypt and decrypt using the EncryptedClient example."""
12
+ """Test function for encrypt and decrypt using the EncryptedTable example."""
13
13
test_kms_key_id = "arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f"
14
14
test_dynamodb_table_name = "DynamoDbEncryptionInterceptorTestTable"
15
15
encrypted_table_put_get_example (test_kms_key_id , test_dynamodb_table_name )
You can’t perform that action at this time.
0 commit comments