forked from awsdocs/aws-doc-sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello_lambda.py
More file actions
29 lines (20 loc) · 752 Bytes
/
hello_lambda.py
File metadata and controls
29 lines (20 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# snippet-start:[python.example.hello_lambda]
import boto3
def main():
"""
List the Lambda functions in your AWS account.
"""
# Create the Lambda client
lambda_client = boto3.client("lambda")
# Use the paginator to list the functions
paginator = lambda_client.get_paginator("list_functions")
response_iterator = paginator.paginate()
print("Here are the Lambda functions in your account:")
for page in response_iterator:
for function in page["Functions"]:
print(f" {function['FunctionName']}")
if __name__ == "__main__":
main()
# snippet-end:[python.example.hello_lambda]