|
1 | 1 | # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
2 | 2 | # SPDX-License-Identifier: Apache-2.0
|
3 | 3 | """
|
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 |
5 | 10 |
|
6 | 11 | 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. |
8 | 13 |
|
9 | 14 | There are three important parameters that users need to carefully set while providing the shared cache:
|
10 | 15 |
|
@@ -210,7 +215,9 @@ def shared_cache_across_hierarchical_keyrings_example(
|
210 | 215 | :param kms_key_id: ARN of the KMS key
|
211 | 216 | """
|
212 | 217 | # 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. |
214 | 221 | # This CMC takes in:
|
215 | 222 | # - CacheType
|
216 | 223 | mat_prov = AwsCryptographicMaterialProviders(config=MaterialProvidersConfig())
|
|
0 commit comments