Skip to content

Commit 8e152e3

Browse files
committed
fix (2)
1 parent 88ee2c0 commit 8e152e3

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

examples/src/keyrings/aws_kms_mrk_keyring_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
"""
4-
This example sets up the KMS MRK (multi-region key) Keyring
4+
This example sets up the AWS KMS MRK (multi-region key) Keyring
55
66
The AWS Key Management Service (AWS KMS) MRK keyring interacts with AWS KMS to
77
create, encrypt, and decrypt data keys with multi-region AWS KMS keys (MRKs).

examples/src/keyrings/aws_kms_mrk_multi_keyring_example.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
"""
4-
This example sets up the KMS MRK Multi Keyring
4+
This example sets up the AWS KMS MRK Multi Keyring
55
66
The AWS Key Management Service (AWS KMS) MRK keyring interacts with AWS KMS to
77
create, encrypt, and decrypt data keys with AWS KMS MRK keys.
@@ -51,15 +51,15 @@ def encrypt_and_decrypt_with_keyring(
5151
mrk_key_id: str,
5252
kms_key_id: str,
5353
mrk_replica_key_id: str,
54-
second_region: str
54+
mrk_replica_decrypt_region: str
5555
):
5656
"""Demonstrate an encrypt/decrypt cycle using a Multi-Keyring made
5757
up of multiple AWS KMS MRK Keyrings
5858
5959
Usage: encrypt_and_decrypt_with_keyring(mrk_key_id,
6060
kms_key_id,
6161
mrk_replica_key_id,
62-
second_region)
62+
mrk_replica_decrypt_region)
6363
:param mrk_key_id: KMS Key identifier for an AWS KMS multi-region key (MRK) located in your
6464
default region
6565
:type mrk_key_id: string
@@ -69,8 +69,8 @@ def encrypt_and_decrypt_with_keyring(
6969
:param mrk_replica_key_id: KMS Key identifier for an MRK that is a replica of the
7070
`mrk_key_id` in a second region.
7171
:type mrk_replica_key_id: string
72-
:param second_region: The second region where the MRK replica is located
73-
:type second_region: string
72+
:param mrk_replica_decrypt_region: The second region where the MRK replica is located
73+
:type mrk_replica_decrypt_region: string
7474
7575
For more information on KMS Key identifiers for multi-region keys, see
7676
https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id
@@ -151,8 +151,8 @@ def encrypt_and_decrypt_with_keyring(
151151

152152
# 9. Create a single AwsKmsMrkKeyring with the replica KMS MRK from the second region.
153153

154-
# Create a boto3 client for KMS in the second region.
155-
second_region_kms_client = boto3.client('kms', region_name=second_region)
154+
# Create a boto3 client for KMS in the second region which is the region for mrk_replica_key_id.
155+
second_region_kms_client = boto3.client('kms', region_name=mrk_replica_decrypt_region)
156156

157157
second_region_mrk_keyring_input: CreateAwsKmsMrkKeyringInput = CreateAwsKmsMrkKeyringInput(
158158
kms_key_id=mrk_replica_key_id,

examples/test/keyrings/test_i_aws_kms_mrk_multi_keyring_example.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ def test_encrypt_and_decrypt_with_keyring():
1616
"arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f"
1717
mrk_replica_key_id = \
1818
"arn:aws:kms:eu-west-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7"
19-
second_region = "eu-west-1"
20-
encrypt_and_decrypt_with_keyring(mrk_key_id, kms_key_id, mrk_replica_key_id, second_region)
19+
mrk_replica_decrypt_region = "eu-west-1"
20+
encrypt_and_decrypt_with_keyring(mrk_key_id,
21+
kms_key_id,
22+
mrk_replica_key_id,
23+
mrk_replica_decrypt_region)

0 commit comments

Comments
 (0)