Skip to content

Instantly share code, notes, and snippets.

@youngsoul
Last active March 7, 2022 19:58
Show Gist options
  • Save youngsoul/2035c89295d10efad49a5ea2a98e49a9 to your computer and use it in GitHub Desktop.
Save youngsoul/2035c89295d10efad49a5ea2a98e49a9 to your computer and use it in GitHub Desktop.
Lambda CDK Example using V2 API
lb1 = lambda_alpha_.PythonFunction(self, f"{resources_prefix}-heartfailure-function",
entry="./ml_lambda",
index="heart_failure_lambda.py",
handler="lambda_handler",
runtime=_lambda.Runtime.PYTHON_3_7,
vpc=self.vpc,
security_groups=[
self.efs_access_sg
],
timeout=Duration.seconds(300),
allow_public_subnet=True,
filesystem=_lambda.FileSystem.from_efs_access_point(access_point,'/mnt/model'),
environment={
"PYTHONPATH": "/mnt/model/venv"
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment