Skip to content

Commit f4f24c7

Browse files
committed
Updates for validation
1 parent 5861f8e commit f4f24c7

File tree

9 files changed

+17
-12
lines changed

9 files changed

+17
-12
lines changed

.doc_gen/metadata/kms_metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ kms_EnableKeyRotation:
786786
- python.example_code.kms.KeyManager
787787
- python.example_code.kms.EnableKeyRotation
788788
services:
789-
kms: {kms_EnableKeyRotation}
789+
kms: {EnableKeyRotation}
790790
kms_Scenario_Basics:
791791
synopsis_list:
792792
- Create a &kms-key;.

javav2/example_code/kms/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav
3838

3939
Code examples that show you how to perform the essential operations within a service.
4040

41-
- [Learn KMS key core operations](src/main/java/com/example/kms/scenario/KMSScenario.java)
41+
- [Learn the basics](src/main/java/com/example/kms/scenario/KMSScenario.java)
4242

4343

4444
### Single actions
@@ -80,7 +80,7 @@ Code excerpts that show you how to call individual service functions.
8080
This example shows you how to get started using KMS key.
8181

8282

83-
#### Learn KMS key core operations
83+
#### Learn the basics
8484

8585
This example shows you how to do the following:
8686

python/example_code/kms/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Code excerpts that show you how to call individual service functions.
5353
- [DescribeKey](key_management.py#L110)
5454
- [DisableKey](key_management.py#L175)
5555
- [EnableKey](key_management.py#L156)
56+
- [EnableKeyRotation](key_management.py#L216)
5657
- [Encrypt](key_encryption.py#L37)
5758
- [GenerateDataKey](key_management.py#L132)
5859
- [GetKeyPolicy](key_policies.py#L62)
@@ -69,7 +70,6 @@ Code excerpts that show you how to call individual service functions.
6970
- [TagResource](key_management.py#L235)
7071
- [UpdateAlias](alias_management.py#L143)
7172
- [Verify](key_encryption.py#L147)
72-
- [kms_EnableKeyRotation](key_management.py#L216)
7373

7474

7575
<!--custom.examples.start-->

python/example_code/kms/grant_management.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, kms_client):
2626
@classmethod
2727
def from_client(cls) -> "GrantManager":
2828
"""
29-
Creates an GrantManager instance with a default KMS client.
29+
Creates a GrantManager instance with a default KMS client.
3030
3131
:return: An instance of GrantManager initialized with the default KMS client.
3232
"""
@@ -73,11 +73,11 @@ def list_grants(self, key_id):
7373
:return: The grants for the key.
7474
"""
7575
try:
76-
paginator = self.kms_client.get_paginator('list_grants')
76+
paginator = self.kms_client.get_paginator("list_grants")
7777
grants = []
7878
page_iterator = paginator.paginate(KeyId=key_id)
7979
for page in page_iterator:
80-
grants.extend(page['Grants'])
80+
grants.extend(page["Grants"])
8181

8282
print(f"Grants for key {key_id}:")
8383
pprint(grants)
@@ -166,7 +166,7 @@ def grant_management(kms_client):
166166
grant_manager.retire_grant(grant)
167167
elif action == "revoke":
168168
grant_manager.revoke_grant(key_id, grant["GrantId"])
169-
print(f"Grant {grant["GrantId"]} revoked.")
169+
print(f"Grant {grant['GrantId']} revoked.")
170170
else:
171171
print("Skipping grant removal.")
172172

python/example_code/kms/key_encryption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, kms_client):
2525
@classmethod
2626
def from_client(cls) -> "KeyEncrypt":
2727
"""
28-
Creates an KeyEncrypt instance with a default KMS client.
28+
Creates a KeyEncrypt instance with a default KMS client.
2929
3030
:return: An instance of KeyEncrypt initialized with the default KMS client.
3131
"""

python/example_code/kms/key_management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, kms_client):
2727
@classmethod
2828
def from_client(cls) -> "KeyManager":
2929
"""
30-
Creates an KeyManager instance with a default KMS client.
30+
Creates a KeyManager instance with a default KMS client.
3131
3232
:return: An instance of KeyManager initialized with the default KMS client.
3333
"""

python/example_code/kms/key_policies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, kms_client):
2727
@classmethod
2828
def from_client(cls) -> "KeyPolicy":
2929
"""
30-
Creates an KeyPolicy instance with a default KMS client.
30+
Creates a KeyPolicy instance with a default KMS client.
3131
3232
:return: An instance of KeyPolicy initialized with the default KMS client.
3333
"""

python/example_code/kms/kms_scenario.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def kms_scenario(self):
4848
"""
4949
Welcome to the AWS Key Management SDK Basics scenario.
5050
51-
This program demonstrates how to interact with AWS Key Management using the AWS SDK for Java (v2).
51+
This program demonstrates how to interact with AWS Key Management using the AWS SDK for Python (Boto3).
5252
The AWS Key Management Service (KMS) is a secure and highly available service that allows you to create
5353
and manage AWS KMS keys and control their use across a wide range of AWS services and applications.
5454
KMS provides a centralized and unified approach to managing encryption keys, making it easier to meet your

python/example_code/kms/test/test_kms_scenario.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
12
# SPDX-License-Identifier: Apache-2.0
23

4+
"""
5+
Unit tests for kms_scenario.py.
6+
"""
7+
38
import json
49

510
import pytest

0 commit comments

Comments
 (0)