-
Notifications
You must be signed in to change notification settings - Fork 556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: apply $AWS_LAMBDA_EXEC_WRAPPER
if set
#524
base: main
Are you sure you want to change the base?
Conversation
Managed AWS Lambda runtimes wrap the function's runtime entry using a script specified by the `AWS_LAMBDA_EXEC_WRAPPER` environment variable, however this is not performed by provided runtimes (`provided`, `provided.al2`, `go1.x`). This adds an `init` function that re-startes the current process after wrapping it in the wrapper to emulate the behavior of other lambda runtimes, although this will cause initialization of some other go packages to be run twice, which will have an impact on cold start times. See also: https://docs.aws.amazon.com/lambda/latest/dg/runtimes-modify.html#runtime-wrapper Fixes aws#523
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #524 +/- ##
==========================================
- Coverage 72.63% 72.24% -0.39%
==========================================
Files 26 27 +1
Lines 1407 1427 +20
==========================================
+ Hits 1022 1031 +9
- Misses 314 323 +9
- Partials 71 73 +2
☔ View full report in Codecov by Sentry. |
I'm not sure about this feature. The feature could cause issues if a current or future version or |
I would suggest the wrapper script is invoked with the |
Managed AWS Lambda runtimes wrap the function's runtime entry using a script specified by the
AWS_LAMBDA_EXEC_WRAPPER
environment variable, however this is not performed by provided runtimes (provided
,provided.al2
,go1.x
).This adds a new
WithEnableExecWrapper()
option that re-startes the current process after wrapping it in the wrapper to emulate the behavior of other lambda runtimes, although this will cause initialization of some other go packages to be run twice, which will have an impact on cold start times.See also: https://docs.aws.amazon.com/lambda/latest/dg/runtimes-modify.html#runtime-wrapper
Fixes #523
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.