You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@suttonsp0 if you check out CDK doc here there is a mention of:
N.B.: if you use the provider framework in this module you will write AWS Lambda Functions that look a lot like,
but aren't exactly the same as the Lambda Functions you would write if you wrote CloudFormation Custom
Resources directly, without this framework.
Specifically, to report success or failure, have your Lambda Function exit in the right way: return data for success,
or throw an exception for failure. Do not post the success or failure of your custom resource to an HTTPS URL
as the CloudFormation documentation tells you to do.
The library takes care to send data back to event['ResponseURL'] but actually you should not do that. You custom resource lambda would be in fact invoked by another lambda which CDK creates silently. That custom lambda expects that your own lambda did a return of the special structure.
In the same document there are examples in Typescript, like:
This issue has got me scratching my head. It started when I built a custom resource and put the data I'm looking for into the helper like so:
helper.Data["FileServerIp"] = file_server_ip
I accessed the data in the python cdk app like so:
This resulted in this error:
I confirmed in the logs that it is returning the ip address correctly:
The weird part is that I configured the lambda to not tear down on failure and then I re-used it from a CloudFormation template like this:
And it worked. I don't know why it would matter that it was compiled from python cdk instead of CloudFormation yet these are the results I see.
This was what the CfnOutput compiled to:
And this is what I had for the custom resource:
This makes CfnResource unusable for my team and unfortunately we'll have to go back to just handling the events directly until this is fixed.
The text was updated successfully, but these errors were encountered: