Skip to content

Commit da6713e

Browse files
committed
Update readme
1 parent af2ea13 commit da6713e

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## cfn_wrapper.py
1+
## cfn_resource.py
22

33
This project is a decorator and validation system that takes the drudgery out
44
of writing custom resources. You still have access to the context and event as
@@ -10,9 +10,9 @@ Templeton if you're looking to write your custom resources in Node.js.
1010

1111
## Usage
1212

13-
1. Copy `cfn_wrapper.py` into the directory of your lambda function handler
14-
1. Use the `cfn_resource` decorator to decorate your handler like in
15-
`example.py`
13+
1. Copy `cfn_resource.py` into the directory of your lambda function handler.py
14+
1. Use the `cfn_resource.Resource` event decorators to decorate your handler
15+
like in `example.py`
1616
1. Zip up the contents and upload to Lambda
1717

1818
Once the function is up, copy its ARN and use it as the ServiceToken for your
@@ -39,16 +39,24 @@ For more on how custom resources work, see the [AWS docs][docs]
3939

4040
## Code Sample
4141

42+
For this example, you need to have your handler in Lambda set as
43+
`filename.handler` where filename has the below contents.
44+
4245
```
43-
import cfn_wrapper
46+
import cfn_resource
4447
4548
# set `handler` as the entry point for Lambda
46-
handler = cfn_wrapper.Resource()
49+
handler = cfn_resource.Resource()
4750
4851
@handler.create
4952
def create_thing(event, context):
5053
# do some stuff
5154
return {"PhysicalResourceId": "arn:aws:fake:myID"}
55+
56+
@handler.update
57+
def update_thing(event, context):
58+
# do some stuff
59+
return {"PhysicalResourceId": "arn:aws:fake:myID"}
5260
```
5361

5462
## License

0 commit comments

Comments
 (0)