Flask in zip function handler startup command configuration when using CDK #417
Unanswered
tehClaytonRH
asked this question in
Q&A
Replies: 1 comment
-
PythonFunction construct tries to make it easy for developers to use it. NodejsFunction construct also had the same issue. It was fixed in this issue. You could raise this issue for PythonFunction in CDK repo. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've managed to follow the Flask Zip example and adapt it for use with CDK, however, it seems as though the resulting python CDK construct isn't configured to allow for startup scripts being passed as handlers. The construct seems to concatenate the passed
index
andhandler
values when configuring the lambda, so as a workaround I did the following:run.py
sh
(in anticipation that the
.py
file extension would be stripped, and the index and handler would be concatenated torun.sh
)run.py
file so as to avoid theRuntime
error thatrun.py
is not foundI was able to get everything working - so my question is whether there is a better approach to setting this lambda up via CDK that doesn't seem so hacky.
Thanks!
Roughly my function definition:
Beta Was this translation helpful? Give feedback.
All reactions