Skip to content

Commit 7586320

Browse files
cevdet25rlhagermbrmur
authored
Updated the logging module line and paginator max item (#7272)
* Updated the logging module line and paginator max item * Updated comments. * Updated the logging module line and paginator max item * Updated comments. --------- Co-authored-by: Rachel Hagerman <[email protected]> Co-authored-by: Brian Murray <[email protected]>
1 parent 2c3b657 commit 7586320

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/example_code/ec2/hello/hello_ec2.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def hello_ec2(ec2_client):
2121
print("Hello, Amazon EC2! Let's list up to 10 of your security groups:")
2222
try:
2323
paginator = ec2_client.get_paginator("describe_security_groups")
24-
response_iterator = paginator.paginate(MaxResults=10)
24+
response_iterator = paginator.paginate(PaginationConfig={'MaxItems': 10}) # List only 10 security groups.
25+
logging.basicConfig(level=logging.INFO) # Enable logging.
2526
for page in response_iterator:
2627
for sg in page["SecurityGroups"]:
2728
logger.info(f"\t{sg['GroupId']}: {sg['GroupName']}")

0 commit comments

Comments
 (0)