Skip to content

Commit 2417a42

Browse files
committed
resolved comments
1 parent b491294 commit 2417a42

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

examples/src/keyrings/aws_kms_mrk_discovery_keyring_example.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
"""
44
This example sets up the AWS KMS MRK (multi-region key) Discovery Keyring
55
6-
AWS KMS discovery keyring is an AWS KMS keyring that doesn't specify any wrapping keys.
7-
The AWS Encryption SDK provides a standard AWS KMS discovery keyring and a discovery keyring
8-
for AWS KMS multi-Region keys. Because it doesn't specify any wrapping keys, a discovery keyring
9-
can't encrypt data. If you use a discovery keyring to encrypt data, alone or in a multi-keyring,
10-
the encrypt operation fails.
6+
The AWS KMS discovery keyring is an AWS KMS keyring that doesn't specify any wrapping keys.
117
128
When decrypting, an MRK discovery keyring allows the AWS Encryption SDK to ask AWS KMS to decrypt
139
any encrypted data key by using the AWS KMS MRK that encrypted it, regardless of who owns or
1410
has access to that AWS KMS key. The call succeeds only when the caller has kms:Decrypt
1511
permission on the AWS KMS MRK.
1612
13+
The AWS Encryption SDK provides a standard AWS KMS discovery keyring and a discovery keyring
14+
for AWS KMS multi-Region keys. Because it doesn't specify any wrapping keys, a discovery keyring
15+
can't encrypt data. If you use a discovery keyring to encrypt data, alone or in a multi-keyring,
16+
the encrypt operation fails.
17+
1718
The AWS Key Management Service (AWS KMS) MRK keyring interacts with AWS KMS to
1819
create, encrypt, and decrypt data keys with multi-region AWS KMS keys (MRKs).
1920
This example creates a KMS MRK Keyring and then encrypts a custom input EXAMPLE_DATA
@@ -27,7 +28,7 @@
2728
For information about using multi-Region keys with the AWS Encryption SDK, see
2829
https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/configure.html#config-mrks
2930
30-
For more info on KMS MRK (multi-region keys), see the KMS documentation:
31+
For more info on KMS MRKs (multi-region keys), see the KMS documentation:
3132
https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html
3233
3334
For more information on how to use KMS Discovery keyrings, see
@@ -63,8 +64,9 @@ def encrypt_and_decrypt_with_keyring(
6364
mrk_encrypt_region: str,
6465
mrk_replica_decrypt_region: str
6566
):
66-
"""Demonstrate an encrypt/decrypt cycle using an AWS KMS MRK Discovery keyring.
67+
"""Demonstrate decryption using an AWS KMS MRK Discovery keyring.
6768
69+
Since discovery keyrings cannot be used to encrypt, we use KMS MRK keyring for encryption
6870
Usage: encrypt_and_decrypt_with_keyring(mrk_key_id_encrypt,
6971
aws_account_id,
7072
mrk_encrypt_region,
@@ -79,9 +81,9 @@ def encrypt_and_decrypt_with_keyring(
7981
:type mrk_encrypt_region: string
8082
:param mrk_replica_decrypt_region: AWS Region for decryption of your data keys.
8183
This example assumes you have already replicated your mrk_key_id_encrypt to the
82-
region mrk_replica_decrypt_region. Therfore, this mrk_replica_decrypt_region should
83-
be the region of the mrk replica key id. However, since we are using a discovery keyring,
84-
we don't need to provide the mrk replica key id
84+
region mrk_replica_decrypt_region. Therefore, this mrk_replica_decrypt_region should
85+
be the region of the MRK replica. However, since we are using a discovery keyring,
86+
we don't need to provide the replica MRK ID.
8587
:type mrk_replica_decrypt_region: string
8688
8789
For more information on KMS Key identifiers for multi-region keys, see

examples/src/keyrings/aws_kms_mrk_discovery_multi_keyring_example.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
66
AWS KMS MRK Discovery Multi Keyring is composed of multiple MRK discovery keyrings.
77
8-
AWS KMS discovery keyring is an AWS KMS keyring that doesn't specify any wrapping keys.
9-
The AWS Encryption SDK provides a standard AWS KMS discovery keyring and a discovery keyring
10-
for AWS KMS multi-Region keys. Because it doesn't specify any wrapping keys, a discovery keyring
11-
can't encrypt data. If you use a discovery keyring to encrypt data, alone or in a multi-keyring,
12-
the encrypt operation fails.
8+
The AWS KMS discovery keyring is an AWS KMS keyring that doesn't specify any wrapping keys.
139
1410
When decrypting, an MRK discovery keyring allows the AWS Encryption SDK to ask AWS KMS to decrypt
1511
any encrypted data key by using the AWS KMS MRK that encrypted it, regardless of who owns or
1612
has access to that AWS KMS key. The call succeeds only when the caller has kms:Decrypt
1713
permission on the AWS KMS MRK.
1814
15+
The AWS Encryption SDK provides a standard AWS KMS discovery keyring and a discovery keyring
16+
for AWS KMS multi-Region keys. Because it doesn't specify any wrapping keys, a discovery keyring
17+
can't encrypt data. If you use a discovery keyring to encrypt data, alone or in a multi-keyring,
18+
the encrypt operation fails.
19+
1920
The AWS Key Management Service (AWS KMS) MRK keyring interacts with AWS KMS to
2021
create, encrypt, and decrypt data keys with multi-region AWS KMS keys (MRKs).
2122
This example creates a KMS MRK Keyring and then encrypts a custom input EXAMPLE_DATA
@@ -29,7 +30,7 @@
2930
For information about using multi-Region keys with the AWS Encryption SDK, see
3031
https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/configure.html#config-mrks
3132
32-
For more info on KMS MRK (multi-region keys), see the KMS documentation:
33+
For more info on KMS MRKs (multi-region keys), see the KMS documentation:
3334
https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html
3435
3536
For more information on how to use KMS Discovery keyrings, see
@@ -63,10 +64,11 @@ def encrypt_and_decrypt_with_keyring(
6364
mrk_key_id_encrypt: str,
6465
mrk_encrypt_region: str,
6566
aws_account_id: str,
66-
aws_regions: str
67+
aws_regions: list[str]
6768
):
68-
"""Demonstrate an encrypt/decrypt cycle using an AWS KMS MRK Discovery Multi keyring.
69+
"""Demonstrate decryption using an AWS KMS MRK Discovery Multi keyring.
6970
71+
Since discovery keyrings cannot be used to encrypt, we use KMS MRK keyring for encryption
7072
Usage: encrypt_and_decrypt_with_keyring(mrk_key_id_encrypt,
7173
mrk_encrypt_region,
7274
aws_account_id,
@@ -79,8 +81,8 @@ def encrypt_and_decrypt_with_keyring(
7981
:type mrk_encrypt_region: string
8082
:param aws_account_id: AWS Account ID to use in the discovery filter
8183
:type aws_account_id: string
82-
:param aws_regions: AWS Region to use in the the discovery filter
83-
:type aws_regions: string
84+
:param aws_regions: AWS Regions to use in the the discovery filter
85+
:type aws_regions: list[string]
8486
8587
For more information on KMS Key identifiers for multi-region keys, see
8688
https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id

0 commit comments

Comments
 (0)