Skip to content

Commit 94be4db

Browse files
committed
add zip file version
1 parent c9abdda commit 94be4db

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed
2.29 MB
Binary file not shown.

monitor-aws-lambda-python-3-6/lambda.py

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import os
2+
import rollbar
3+
4+
5+
ROLLBAR_KEY = os.getenv('ROLLBAR_SECRET_KEY', 'missing Rollbar secret key')
6+
rollbar.init(ROLLBAR_KEY, 'production')
7+
8+
9+
@rollbar.lambda_function
10+
def lambda_handler(event, context):
11+
message = os.getenv("message")
12+
print_count = int(os.getenv("print_count"))
13+
14+
# check if message exists and how many times to print it
15+
if message and print_count > 0:
16+
for i in range(0, print_count):
17+
# formatted string literals are new in Python 3.6
18+
print(f"message: {message}.")
19+
return print_count
20+
return None
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rollbar==0.13.18

0 commit comments

Comments
 (0)