-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Lambda runtime parity #7824
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
Lambda runtime parity #7824
Conversation
@@ -9,7 +9,7 @@ | |||
|
|||
LAMBDA_RUNTIME_INIT_URL = "https://github.com/localstack/lambda-runtime-init/releases/download/{version}/aws-lambda-rie-{arch}" | |||
|
|||
LAMBDA_RUNTIME_DEFAULT_VERSION = "v0.1.11-pre" | |||
LAMBDA_RUNTIME_DEFAULT_VERSION = "v0.1.12-pre" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the key change adopting the new RIE release including https://github.com/localstack/lambda-runtime-init/pull/13/files
a5a5687
to
f171537
Compare
} | ||
# Conditionally added environment variables | ||
# TODO: Can handler be None? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can handler be None?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In image lambdas, yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, at API level Handler
is only required for zip lambdas. I added a clarifying comment.
The _HANDLER
environment variable is then populated at runtime (e.g., by RIE). Examples:
/application
for the aws-samples app lambda-from-containerapp.handler
in our ext testtests.integration.test_lambda.TestLambdaContainer.test_lambda_from_image
Sidenote: CDK validates it TypeError: Function.__init__() missing 1 required keyword-only argument: 'handler'
(see example here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Good idea to reorder the env variables by context, rather than purely alphabetically 👍
f171537
to
a44792e
Compare
Skip dropping privileges in debug mode
a44792e
to
8a3301b
Compare
Improves lambda runtime parity related to user and environment variables:
sbx_user1051
user for runtime parity and drop root privileges.LAMBDA_INIT_USER
flag and populate it automatically to overcome RIE debugging limitation when dropping privilegesRelated to localstack/lambda-runtime-init#13
Addresses #7722