PYTHON-3615 Add docs example for how to rotate CMKs using rewrap_many_data_key (#1171)

This commit is contained in:
Julius Park 2023-03-21 16:59:35 -07:00 committed by GitHub
parent 04c9f87d70
commit 880f3dd8ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1021,6 +1021,23 @@ class ClientEncryption(Generic[_DocumentType]):
:Returns:
A :class:`RewrapManyDataKeyResult`.
This method allows you to re-encrypt all of your data-keys with a new CMK, or master key.
Note that this does *not* require re-encrypting any of the data in your encrypted collections,
but rather refreshes the key that protects the keys that encrypt the data:
.. code-block:: python
client_encryption.rewrap_many_data_key(
filter={"keyAltNames": "optional filter for which keys you want to update"},
master_key={
"provider": "azure", # replace with your cloud provider
"master_key": {
# put the rest of your master_key options here
"key": "<your new key>"
},
},
)
.. versionadded:: 4.2
"""
self._check_closed()