aws-samples / aws-cdk-examples

Example projects using the AWS CDK
Apache License 2.0
4.96k stars 2.1k forks source link

Fixing KeyError in CustomResource lambda #931

Closed meniluca closed 9 months ago

meniluca commented 9 months ago

Fixing the property name in the input event JSON as the custom-resource-handler.py lambda throws the following error:

[ERROR] 2023-10-05T16:16:39.193Z    xxxx-xxx-xxx-xxx-xxxx   'Message'
Traceback (most recent call last):
  File "/var/task/index.py", line 17, in main
    message = event['ResourceProperties']['Message']
KeyError: 'Message'

I have preferred not changing the interface (maintaining the camel case), but changing the dict directly as it was just one correction VS two. Let me know.

BR Luca


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.