I'm trying to automate the lambda creation process.
I have put the lambda creation function inside a loop and I got this problem: when I check the lambda functions created on the AWS dashboard, reading the content (the source code) I see that all the lambdas have the same code.
lambda_function = _lambda.Function(self,
id=function['lambda_name'],
handler='lambda_function.lambda_handler',
runtime=_lambda.Runtime.PYTHON_3_8,
code=_lambda.Code.from_asset(tmp_lambda_path),
memory_size=function.get('memory_size', 320),
timeout=core.Duration.minutes(1),
log_retention=_logs.RetentionDays.THREE_DAYS,
layers=[app_layer])