Skip to content

document LAMBDA_RUNTIME_VALIDATION #1384

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

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Conversation

HarshCasper
Copy link
Member

No description provided.

Copy link

github-actions bot commented Jul 17, 2024

🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-1384.surge.sh 🎊

@HarshCasper HarshCasper requested a review from joe4dev July 17, 2024 11:31
Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding that missing configuration @HarshCasper 👍

Feel free to use my clarified suggestion.

//cc @Morijarti linking this docs PR in the backlog item

@@ -226,6 +226,7 @@ Please consult the [migration guide]({{< ref "user-guide/aws/lambda#migrating-to
| `LAMBDA_RUNTIME_IMAGE_MAPPING` | [base images for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-images.html) (default) | Customize the Docker image of Lambda runtimes, either by:<br> a) pattern with `<runtime>` placeholder, e.g. `custom-repo/lambda-<runtime>:2022` <br> b) json dict mapping the `<runtime>` to an image, e.g. `{"python3.9": "custom-repo/lambda-py:thon3.9"}` |
| `LAMBDA_SYNCHRONOUS_CREATE` | `0` (default) | Set to `1` to create lambda functions synchronously (not recommended). |
| `LAMBDA_TRUNCATE_STDOUT` | `2000` (default) | Allows increasing the default char limit for truncation of lambda log lines when printed in the console. This does not affect the logs processing in CloudWatch. |
| `LAMBDA_RUNTIME_VALIDATION` | `0` (default) | Enable validation of the runtime environment before starting the Lambda function. Set to `1` to ensure you are not using an unsupported/deprecated runtime. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep alphabetic ordering?

@@ -226,6 +226,7 @@ Please consult the [migration guide]({{< ref "user-guide/aws/lambda#migrating-to
| `LAMBDA_RUNTIME_IMAGE_MAPPING` | [base images for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-images.html) (default) | Customize the Docker image of Lambda runtimes, either by:<br> a) pattern with `<runtime>` placeholder, e.g. `custom-repo/lambda-<runtime>:2022` <br> b) json dict mapping the `<runtime>` to an image, e.g. `{"python3.9": "custom-repo/lambda-py:thon3.9"}` |
| `LAMBDA_SYNCHRONOUS_CREATE` | `0` (default) | Set to `1` to create lambda functions synchronously (not recommended). |
| `LAMBDA_TRUNCATE_STDOUT` | `2000` (default) | Allows increasing the default char limit for truncation of lambda log lines when printed in the console. This does not affect the logs processing in CloudWatch. |
| `LAMBDA_RUNTIME_VALIDATION` | `0` (default) | Enable validation of the runtime environment before starting the Lambda function. Set to `1` to ensure you are not using an unsupported/deprecated runtime. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly correct. I suggest the following clarified version:

Set to 1 to enforce strict AWS parity by raising an exception when using a deprecated Lambda runtime for the API operation CreateFunction. Deprecated Lambda runtimes (e.g., nodejs14.x) can be used with disabled validation (current default).

Notice that full parity for UpdateFunctionConfiguration mirroring the staged deprecation phase at AWS (i.e., block create, block update, etc) is not supported. It's a rabbit hole with diminishing benefits for LocalStack.

Full details are in the backlog item "Add Lambda option to disable runtime validations":

  • LAMBDA_RUNTIME_VALIDATION=1 enforces strict AWS parity by raising an exception. In the LocalStack logs, it prints a hint about the configuration to disable validation for using deprecated runtimes.
  • LAMBDA_RUNTIME_VALIDATION=0 does not validate the string value of the provided Lambda runtime and enables creating functions for deprecated runtimes. It does still raises an exception if no implementation is available.

@HarshCasper HarshCasper merged commit 0c95618 into main Jul 17, 2024
3 checks passed
@HarshCasper HarshCasper deleted the LAMBDA_RUNTIME_VALIDATION branch July 17, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants