chalice icon indicating copy to clipboard operation
chalice copied to clipboard

Can't find lamdba name in CDK and can't get os.env on_dynamodb_record

Open mkubasz opened this issue 2 years ago • 3 comments

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', ''))

mkubasz avatar Jun 22 '22 16:06 mkubasz

I got the same first error, any one can help here?

csdhong avatar Jul 15 '22 01:07 csdhong

Maybe you could help @jamesls

mkubasz avatar Jul 20 '22 10:07 mkubasz

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).

tzelleke avatar Jul 03 '23 17:07 tzelleke