chalice
chalice copied to clipboard
Can't find lamdba name in CDK and can't get os.env on_dynamodb_record
Hi, I have two issues:
@app.lambda_function('category_event_handler')
def category_event_handler(event, context):
di['category_event_handler'].handler(event)
di['backup_event_handler'].handler(event)
In chalice app I had: Error: Resource with logical ID 'category_event_handler' was not found in the template
In the line
print(self.chalice.get_function('category_event_handler'))
Second Issue:
In kinesis and dynamodb rais an error
Resource referenced in Fn::Sub expression with logical ID: 'Token[TOKEN' was not found in the template
using this line
@app.on_kinesis_record(stream=os.environ.get('PRODUCT_STREAM', ''))
I got the same first error, any one can help here?
Maybe you could help @jamesls
You get the error w.r.t. the Lambda handler because the logical ID is generated in PascalCase, i.e. "CategoryEventHandler".
You can observe that in the generated SAM template (cdk.out/<stack-name>.template.json
, remove the print(...)
that is throwing the error).