Skip to content

Commit 3ad1234

Browse files
committed
single-thread feedback
1 parent 357ffd5 commit 3ad1234

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Examples/runtimes/python/DynamoDBEncryption/src/keyring/shared_cache_across_hierarchical_keyrings_example.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
"""
4-
Example demonstrates how to use a shared cache across multiple Hierarchical Keyrings.
4+
Example demonstrates how to use a shared cache across multiple Hierarchical Keyrings in single-threaded environments.
5+
6+
IMPORTANT: This example and the shared cache functionality should ONLY be used in single-threaded environments.
7+
The AWS Cryptographic Material Providers Library (MPL) for Python does not support multithreading for
8+
components that interact with KMS. For more information about multithreading limitations, see:
9+
https://github.com/aws/aws-cryptographic-material-providers-library/blob/main/AwsCryptographicMaterialProviders/runtimes/python/README.rst
510
611
With this functionality, users only need to maintain one common shared cache across multiple
7-
Hierarchical Keyrings with different Key Stores instances/KMS Clients/KMS Keys.
12+
Hierarchical Keyrings with different Key Stores instances/KMS Clients/KMS Keys in a single-threaded environment.
813
914
There are three important parameters that users need to carefully set while providing the shared cache:
1015
@@ -210,7 +215,9 @@ def shared_cache_across_hierarchical_keyrings_example(
210215
:param kms_key_id: ARN of the KMS key
211216
"""
212217
# 1. Create the CryptographicMaterialsCache (CMC) to share across multiple Hierarchical Keyrings
213-
# using the Material Providers Library
218+
# using the Material Providers Library in a single-threaded environment.
219+
# IMPORTANT: This shared cache must only be used in single-threaded environments as the
220+
# MPL for Python does not support multithreading for KMS operations.
214221
# This CMC takes in:
215222
# - CacheType
216223
mat_prov = AwsCryptographicMaterialProviders(config=MaterialProvidersConfig())

0 commit comments

Comments
 (0)