Skip to content

Commit 78d8b43

Browse files
committed
Update example
1 parent e590781 commit 78d8b43

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

example.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# MIT Licensed, Copyright (c) 2015 Ryan Scott Brown <sb@ryansb.com>
22

3-
from cfn_wrapper import cfn_resource
4-
5-
@cfn_resource
6-
def lambda_handler(event, context):
7-
# deal with your external service here
8-
return {
9-
"Status": "SUCCESS",
10-
"Reason": "Life is good, man",
11-
"PhysicalResourceId": "some:fake:id",
12-
"Data": {},
13-
}
3+
import cfn_resource
4+
5+
# set `handler` as the entry point for Lambda
6+
handler = cfn_resource.Resource()
7+
8+
@handler.create
9+
def create_thing(event, context):
10+
# do some stuff
11+
return {"PhysicalResourceId": "arn:aws:fake:myID"}
12+
13+
@handler.update
14+
def update_thing(event, context):
15+
# do some stuff
16+
return {"PhysicalResourceId": "arn:aws:fake:myID"}

0 commit comments

Comments
 (0)