I'm attempting to translate a YAML CloudFormation template into AWS's CDK using Python. I am currently stuck on instantiating a lambda CfnFunction. It appears that I am not satisfying the required "code" parameter.
My current code looks like:
firehose_trans_lambda = _lambda.CfnFunction(self, "FirehoseTransformLambda",
description="foo",
code=,
handler="lambda_function.handler",
role="LambdaTransformRole.Arn",
runtime="python3.8",
)
According to the CDK documentation, the "code" field should be of type (Union[Forwardref, IResolvable]). I have no idea what this means, and the documentation isn't very helpful. Does anybody have any insight as to what I could put in there to satisfy the requirements? I was thinking of trying either a reference to some lambda or a piece of inline code, but am not sure how to go about doing that (I have tried various things, but my Python skills aren't the strongest).