From de760ff851902683258a649aa4bfbd80efa0f3cd Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Fri, 23 Dec 2022 14:37:20 +0100 Subject: [PATCH 01/13] add scaffold --- content/en/references/lambda-asf-provider.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 content/en/references/lambda-asf-provider.md diff --git a/content/en/references/lambda-asf-provider.md b/content/en/references/lambda-asf-provider.md new file mode 100644 index 0000000000..0f46b4f35a --- /dev/null +++ b/content/en/references/lambda-asf-provider.md @@ -0,0 +1,3 @@ +# Lambda Provider Behavioral Changes + +## Changes in Hot Reloading From 4287338cd2a0e51f10060a08e2f8359047257188 Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Fri, 23 Dec 2022 14:38:20 +0100 Subject: [PATCH 02/13] add site header --- content/en/references/lambda-asf-provider.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/content/en/references/lambda-asf-provider.md b/content/en/references/lambda-asf-provider.md index 0f46b4f35a..9f7138398d 100644 --- a/content/en/references/lambda-asf-provider.md +++ b/content/en/references/lambda-asf-provider.md @@ -1,3 +1,10 @@ +--- +title: "Lambda ASF Provider" +weight: 5 +description: > + Behavioral changes to become default with the new lambda provider +--- + # Lambda Provider Behavioral Changes ## Changes in Hot Reloading From c89cbea45fa9a0de44853304619d32e80144a7f3 Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Fri, 23 Dec 2022 14:53:30 +0100 Subject: [PATCH 03/13] add hot swapping changes --- content/en/references/lambda-asf-provider.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/content/en/references/lambda-asf-provider.md b/content/en/references/lambda-asf-provider.md index 9f7138398d..429e1f4be9 100644 --- a/content/en/references/lambda-asf-provider.md +++ b/content/en/references/lambda-asf-provider.md @@ -1,5 +1,5 @@ --- -title: "Lambda ASF Provider" +title: "Lambda new Provider" weight: 5 description: > Behavioral changes to become default with the new lambda provider @@ -7,4 +7,17 @@ description: > # Lambda Provider Behavioral Changes -## Changes in Hot Reloading +## Changes in Hot Swapping +The magic key for hot reloading (or swapping) buckets has changed from `__local__` to `hot-reload`. +While the former is still supported in the old provider, the new one will only support the latter. +The configuration variable `BUCKET_MARKER_LOCAL` is still respected. +Since the new Lambda provider does not restart the containers after each invocation, even for hot reloading, the filesystem will stay the same. + +Also, the runtime inside the container will only be restarted after a change. +So any initialization you do, will only be redone for invocations after a change in the specified code folders which leads to faster invocation times if nothing changed. +Please keep in mind that any changes to the filesystem (for example in /tmp) will not be deleted if the function code changed. + +{{< alert title="Keep in mind" color="warning">}} +It can take up to 700ms for the lambda to represent the changes you did in the code folder. Until that time has passed, any invocations will still be executed on the former code. +If using Docker Desktop, you might need to allow file sharing for your target folders: [https://docs.docker.com/desktop/settings/mac/#file-sharing](https://docs.docker.com/desktop/settings/mac/#file-sharing) +{{< /alert >}} \ No newline at end of file From 308be300c8afa3fba2e3005d0fc75073fd573b2f Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Fri, 23 Dec 2022 14:53:10 +0100 Subject: [PATCH 04/13] update lambda provider doc --- content/en/user-guide/aws/lambda/index.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/content/en/user-guide/aws/lambda/index.md b/content/en/user-guide/aws/lambda/index.md index 3584f572d8..4a44931866 100644 --- a/content/en/user-guide/aws/lambda/index.md +++ b/content/en/user-guide/aws/lambda/index.md @@ -8,15 +8,25 @@ aliases: - /aws/lambda/ --- +{{< alert title="Switching to the new implementation" color="warning" >}} +A new implementation of the Lambda service is available since LocalStack 1.3. +Set `PROVIDER_OVERRIDE_LAMBDA=asf` when starting LocalStack and let us know if you experience any issues! + +Starting with LocalStack 2.0 the current Lambda implementation will be deprecated in favor of this new provider. +{{< /alert >}} + + AWS Lambda is a Serverless Function as a Service (FaaS) system that allows you to write code in your favorite programming language and run it on the AWS ecosystem. Unlike deploying your code on a server, you can now break down your application into many independent functions and deploy them as a singular units. With the help of AWS Lambda, you can strive for more modular code that can be tested and debugged while integrated with the AWS infrastructure and your core system. LocalStack allows you to execute your Lambda functions locally, without the need to deploy them to AWS. This is a great way to test your code, and to learn more about how your Lambda functions work, before deploying them to AWS. LocalStack allows you to execute your Lambda functions, in various execution modes, which is detailed on our [Lambda execution modes]({{< ref "lambda-executors" >}}) page. ## Lambda Providers -LocalStack's Lambda support is available via two providers: `old` and `asf`. For users, switching between the two providers has a lot of impacts. Using the `PROVIDER_OVERRIDE_lambda`, you can switch between the two providers. The `old` provider is the default provider, and the `asf` provider is ASF, our new and more stable provider. The `old` provider is loaded by default, and you need to set `PROVIDER_OVERRIDE_lambda=asf` to use the ASF provider. +LocalStack's Lambda support is available via two providers, the old one and our new and more stable provider (labeled `asf` after our new internal service framework). Set the `PROVIDER_OVERRIDE_LAMBDA` variable to switch between the two providers, e.g. `PROVIDER_OVERRIDE_LAMBDA=asf`. -With v2.0, the default will be changed to ASF, but the old provider will still be available (using the feature flag with the value `legacy`), though it will be removed in further releases. Currently, `asf_pro`, meant for licensed users for LocalStack, isn't available. +By default LocalStack sill uses the old provider. +With LocalStack v2.0, this will be changed to ASF, but the old provider will still be available, in case you need some additional time to migrate. +This fallback option will then be removed in further releases. ## Special tooling for Lambdas From 013601d4f9fd436a565e3739f8ef4d01d6b01bfa Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Fri, 23 Dec 2022 14:56:40 +0100 Subject: [PATCH 05/13] add space --- content/en/references/lambda-asf-provider.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/en/references/lambda-asf-provider.md b/content/en/references/lambda-asf-provider.md index 429e1f4be9..e44a6f0860 100644 --- a/content/en/references/lambda-asf-provider.md +++ b/content/en/references/lambda-asf-provider.md @@ -19,5 +19,6 @@ Please keep in mind that any changes to the filesystem (for example in /tmp) wil {{< alert title="Keep in mind" color="warning">}} It can take up to 700ms for the lambda to represent the changes you did in the code folder. Until that time has passed, any invocations will still be executed on the former code. + If using Docker Desktop, you might need to allow file sharing for your target folders: [https://docs.docker.com/desktop/settings/mac/#file-sharing](https://docs.docker.com/desktop/settings/mac/#file-sharing) {{< /alert >}} \ No newline at end of file From 1a88759e2183580d670ab3b9f884d3f9dc91ecd5 Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Fri, 23 Dec 2022 15:17:06 +0100 Subject: [PATCH 06/13] update config for new provider --- content/en/references/configuration.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/content/en/references/configuration.md b/content/en/references/configuration.md index 4343a51fad..7273cc10aa 100644 --- a/content/en/references/configuration.md +++ b/content/en/references/configuration.md @@ -139,7 +139,23 @@ While the ElasticSearch API is actively maintained, the configuration variables | `KINESIS_LATENCY` | `500` (default), `0` (to disable)| Integer value of milliseconds, causing the Kinesis API to delay returning a response in order to mimic latency from a live AWS call. | | `KINESIS_INITIALIZE_STREAMS` | `"my-first-stream:1,my-other-stream:2:us-west-2,my-last-stream:1"` | A comma-delimited string of stream names, its corresponding shard count and an optional region to initialize during startup. If the region is not provided, the default region is used. Only works with the `kinesis-mock` `KINESIS_PROVIDER`. | -### Lambda +### Lambda (New / `asf`) + +| Variable| Example Values | Description | +| - | - | - | +| `LAMBDA_TRUNCATE_STDOUT` | `2000` (default) | Allows increasing the default char value for truncation of lambda logs.| +| `BUCKET_MARKER_LOCAL` | `hot-reload` (default) | Optional bucket name for running lambdas locally.| +| `LAMBDA_DOCKER_NETWORK` | | Optional Docker network for the container running your lambda function. This configuration value also applies to ECS containers. Needs to be set to the network the LocalStack container is connected to if not default bridge network. | +| `LAMBDA_DOCKER_FLAGS` | `-e KEY=VALUE`, `-v host:container`, `-p host:container`, `--add-host domain:ip` | Additional flags passed to Lambda Docker `run`\|`create` commands (e.g., useful for specifying custom volume mounts). Does only support environment, volume, port and add-host flags | +| `LAMBDA_REMOVE_CONTAINERS` | `1` (default) | Whether to remove containers after Lambdas being inactive for 10 minutes. Only applicable when using docker-reuse executor. | +| `LAMBDA_RUNTIME_EXECUTOR` | `docker` (default) | Where Lambdas will be executed | +| | `kubernetes` | PRO-only. Execute lambdas in a Kubernetes cluster | +| `LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT` | `1` (default) | Whether to remove containers after Lambdas being inactive for 10 minutes. Only applicable when using docker-reuse executor. | +| `LAMBDA_RUNTIME_IMAGE_MAPPING` | | Allows two options to customize the resolution of Lambda runtime:\n1. pattern with placeholder, e.g. "custom-repo/lambda-:2022"\n2. json dict mapping the to an image, e.g. '{"python3.9": "custom-repo/lambda-py:thon3.9"}' | +| `LAMBDA_K8S_IMAGE_PREFIX` | `amazon/aws-lambda-` (default) | Prefix for images that will be used to execute Lambda functions. | + + +### Lambda (Legacy) | Variable| Example Values | Description | | - | - | - | From b7bf52d34c542e651984fe383c0a243b10fe613b Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Fri, 23 Dec 2022 15:17:27 +0100 Subject: [PATCH 07/13] add more behavioral changes --- content/en/references/lambda-asf-provider.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/content/en/references/lambda-asf-provider.md b/content/en/references/lambda-asf-provider.md index e44a6f0860..0ce90bd9d6 100644 --- a/content/en/references/lambda-asf-provider.md +++ b/content/en/references/lambda-asf-provider.md @@ -6,6 +6,22 @@ description: > --- # Lambda Provider Behavioral Changes +The new lambda provider has some significant changes in its behavior. + +## API +Increased parity across all Lambda API methods. +Another improvement is the better input validation, so expect more invalid input to fail. +This includes, but is not limited to Lambda roles, which, while not having to be existent, now have to be a correct IAM role arn. (Using arbitrary strings like "r1" is no longer supported). + +## Execution +Lambda will now, by default, reuse containers for each lambda version. +This leads to significantly increased execution times (from ~800 - 1000ms from the old `docker` executor to around 10ms for a simple echo lambda). +This reuse leads to initialization / global state of your lambdas will stay the same between, as long as it is executed on the same environment. + +Multiple concurrent executions will cause LocalStack to scale up to multiple environments, which leads to real parallel execution being available. + +Timeouts are now properly supported, and will, as in AWS, not kill the environment itself (filesystem stays the same) but only restart the internal infrastructure (your code), as do function errors. + ## Changes in Hot Swapping The magic key for hot reloading (or swapping) buckets has changed from `__local__` to `hot-reload`. From 86a76c5fca09e4ca1122ebb18e835ec9645102c5 Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Fri, 23 Dec 2022 15:23:33 +0100 Subject: [PATCH 08/13] misc. config updates --- content/en/references/configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/references/configuration.md b/content/en/references/configuration.md index 7273cc10aa..bf1db9d7a2 100644 --- a/content/en/references/configuration.md +++ b/content/en/references/configuration.md @@ -150,8 +150,8 @@ While the ElasticSearch API is actively maintained, the configuration variables | `LAMBDA_REMOVE_CONTAINERS` | `1` (default) | Whether to remove containers after Lambdas being inactive for 10 minutes. Only applicable when using docker-reuse executor. | | `LAMBDA_RUNTIME_EXECUTOR` | `docker` (default) | Where Lambdas will be executed | | | `kubernetes` | PRO-only. Execute lambdas in a Kubernetes cluster | -| `LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT` | `1` (default) | Whether to remove containers after Lambdas being inactive for 10 minutes. Only applicable when using docker-reuse executor. | -| `LAMBDA_RUNTIME_IMAGE_MAPPING` | | Allows two options to customize the resolution of Lambda runtime:\n1. pattern with placeholder, e.g. "custom-repo/lambda-:2022"\n2. json dict mapping the to an image, e.g. '{"python3.9": "custom-repo/lambda-py:thon3.9"}' | +| `LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT` | `10` (default) | How many seconds Lambda will wait for the runtime environment to start up | +| `LAMBDA_RUNTIME_IMAGE_MAPPING` | | Allows two options to customize the resolution of Lambda runtime:
1. pattern with placeholder, e.g. `custom-repo/lambda-:2022`
2. json dict mapping the to an image, e.g. `{"python3.9": "custom-repo/lambda-py:thon3.9"}` | | `LAMBDA_K8S_IMAGE_PREFIX` | `amazon/aws-lambda-` (default) | Prefix for images that will be used to execute Lambda functions. | From 69dc2932fbd96de2a04452d9e248ea4f59229bc5 Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Fri, 23 Dec 2022 15:24:34 +0100 Subject: [PATCH 09/13] fix runtime placeholder --- content/en/references/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/references/configuration.md b/content/en/references/configuration.md index bf1db9d7a2..08d4a035fd 100644 --- a/content/en/references/configuration.md +++ b/content/en/references/configuration.md @@ -151,7 +151,7 @@ While the ElasticSearch API is actively maintained, the configuration variables | `LAMBDA_RUNTIME_EXECUTOR` | `docker` (default) | Where Lambdas will be executed | | | `kubernetes` | PRO-only. Execute lambdas in a Kubernetes cluster | | `LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT` | `10` (default) | How many seconds Lambda will wait for the runtime environment to start up | -| `LAMBDA_RUNTIME_IMAGE_MAPPING` | | Allows two options to customize the resolution of Lambda runtime:
1. pattern with placeholder, e.g. `custom-repo/lambda-:2022`
2. json dict mapping the to an image, e.g. `{"python3.9": "custom-repo/lambda-py:thon3.9"}` | +| `LAMBDA_RUNTIME_IMAGE_MAPPING` | | Allows two options to customize the resolution of Lambda runtime:
1. pattern with `` placeholder, e.g. `custom-repo/lambda-:2022`
2. json dict mapping the to an image, e.g. `{"python3.9": "custom-repo/lambda-py:thon3.9"}` | | `LAMBDA_K8S_IMAGE_PREFIX` | `amazon/aws-lambda-` (default) | Prefix for images that will be used to execute Lambda functions. | From 3967c336284c1ae913263e46f516c7084cc4cc85 Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Fri, 23 Dec 2022 15:25:22 +0100 Subject: [PATCH 10/13] add only for kubernetes note --- content/en/references/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/references/configuration.md b/content/en/references/configuration.md index 08d4a035fd..c82cf95b7c 100644 --- a/content/en/references/configuration.md +++ b/content/en/references/configuration.md @@ -152,7 +152,7 @@ While the ElasticSearch API is actively maintained, the configuration variables | | `kubernetes` | PRO-only. Execute lambdas in a Kubernetes cluster | | `LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT` | `10` (default) | How many seconds Lambda will wait for the runtime environment to start up | | `LAMBDA_RUNTIME_IMAGE_MAPPING` | | Allows two options to customize the resolution of Lambda runtime:
1. pattern with `` placeholder, e.g. `custom-repo/lambda-:2022`
2. json dict mapping the to an image, e.g. `{"python3.9": "custom-repo/lambda-py:thon3.9"}` | -| `LAMBDA_K8S_IMAGE_PREFIX` | `amazon/aws-lambda-` (default) | Prefix for images that will be used to execute Lambda functions. | +| `LAMBDA_K8S_IMAGE_PREFIX` | `amazon/aws-lambda-` (default) | Prefix for images that will be used to execute Lambda functions in kubernetes. | ### Lambda (Legacy) From 68187541453139c6dc24a033a180486d105aaadf Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Fri, 23 Dec 2022 15:33:46 +0100 Subject: [PATCH 11/13] going over provider text --- content/en/references/lambda-asf-provider.md | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/content/en/references/lambda-asf-provider.md b/content/en/references/lambda-asf-provider.md index 0ce90bd9d6..4c21e578fc 100644 --- a/content/en/references/lambda-asf-provider.md +++ b/content/en/references/lambda-asf-provider.md @@ -9,32 +9,33 @@ description: > The new lambda provider has some significant changes in its behavior. ## API -Increased parity across all Lambda API methods. -Another improvement is the better input validation, so expect more invalid input to fail. -This includes, but is not limited to Lambda roles, which, while not having to be existent, now have to be a correct IAM role arn. (Using arbitrary strings like "r1" is no longer supported). +Parity with AWS has been increased across all Lambda API methods. +Another improvement is the stricter input validation, so expect more invalid input to fail. +One example of this, are Lambda roles. While don't have to actually exist, now have to be at least in a valid ARN format. Using arbitrary strings like `r1` is no longer supported. ## Execution Lambda will now, by default, reuse containers for each lambda version. -This leads to significantly increased execution times (from ~800 - 1000ms from the old `docker` executor to around 10ms for a simple echo lambda). -This reuse leads to initialization / global state of your lambdas will stay the same between, as long as it is executed on the same environment. +This leads to significantly decreased execution times (from ~800 - 1000ms from the old `docker` executor to around 10ms for a simple echo lambda). +Initialization / global state of your lambdas will stay the same between invocations, as long as it is executed in the same environment. -Multiple concurrent executions will cause LocalStack to scale up to multiple environments, which leads to real parallel execution being available. +Multiple concurrent executions will cause LocalStack to scale up and start additional environments for your function, to allow parallel executions. Timeouts are now properly supported, and will, as in AWS, not kill the environment itself (filesystem stays the same) but only restart the internal infrastructure (your code), as do function errors. ## Changes in Hot Swapping The magic key for hot reloading (or swapping) buckets has changed from `__local__` to `hot-reload`. -While the former is still supported in the old provider, the new one will only support the latter. -The configuration variable `BUCKET_MARKER_LOCAL` is still respected. +While the former is still supported in the old provider, the new one (`asf`) will only support the latter. +The configuration variable `BUCKET_MARKER_LOCAL` is still respected. Use this if you want to customize its name. Since the new Lambda provider does not restart the containers after each invocation, even for hot reloading, the filesystem will stay the same. -Also, the runtime inside the container will only be restarted after a change. -So any initialization you do, will only be redone for invocations after a change in the specified code folders which leads to faster invocation times if nothing changed. +Since the runtime inside the container will only be restarted after a change, any initialization you do, will only be reset for invocations after a change in the specified code folders. +This leads to faster invocation times if no changes have occurred. + Please keep in mind that any changes to the filesystem (for example in /tmp) will not be deleted if the function code changed. {{< alert title="Keep in mind" color="warning">}} -It can take up to 700ms for the lambda to represent the changes you did in the code folder. Until that time has passed, any invocations will still be executed on the former code. +It can take up to 700ms for the lambda to detect the changes you did in the code folder. Until that time has passed, any invocations will still be executed on the former code. If using Docker Desktop, you might need to allow file sharing for your target folders: [https://docs.docker.com/desktop/settings/mac/#file-sharing](https://docs.docker.com/desktop/settings/mac/#file-sharing) {{< /alert >}} \ No newline at end of file From 91a2f44a0560448668b0dd1bbbdb7f8bff4424ac Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Fri, 23 Dec 2022 15:36:19 +0100 Subject: [PATCH 12/13] more links, more content --- content/en/references/lambda-asf-provider.md | 9 +++++++-- content/en/user-guide/aws/lambda/index.md | 3 ++- .../user-guide/tools/lambda-tools/hot-swapping/index.md | 7 +++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/content/en/references/lambda-asf-provider.md b/content/en/references/lambda-asf-provider.md index 4c21e578fc..6e152d860b 100644 --- a/content/en/references/lambda-asf-provider.md +++ b/content/en/references/lambda-asf-provider.md @@ -1,12 +1,13 @@ --- -title: "Lambda new Provider" +title: "Lambda Provider Behavioral Changes" weight: 5 description: > Behavioral changes to become default with the new lambda provider --- -# Lambda Provider Behavioral Changes +## Overview The new lambda provider has some significant changes in its behavior. +This includes both its API parity, the execution and the container environments themselves. ## API Parity with AWS has been increased across all Lambda API methods. @@ -14,6 +15,10 @@ Another improvement is the stricter input validation, so expect more invalid inp One example of this, are Lambda roles. While don't have to actually exist, now have to be at least in a valid ARN format. Using arbitrary strings like `r1` is no longer supported. ## Execution +Lambda will now use the official AWS provided lambda images, instead of lambci images. +This leads to an increased parity with the AWS Lambda environments. +Another effect is that lambda now supports ARM containers, which will be executed depending on your host machine architecture (only available for runtimes based on amazon linux 2). + Lambda will now, by default, reuse containers for each lambda version. This leads to significantly decreased execution times (from ~800 - 1000ms from the old `docker` executor to around 10ms for a simple echo lambda). Initialization / global state of your lambdas will stay the same between invocations, as long as it is executed in the same environment. diff --git a/content/en/user-guide/aws/lambda/index.md b/content/en/user-guide/aws/lambda/index.md index 4a44931866..1b5aa5698b 100644 --- a/content/en/user-guide/aws/lambda/index.md +++ b/content/en/user-guide/aws/lambda/index.md @@ -13,6 +13,7 @@ A new implementation of the Lambda service is available since LocalStack 1.3. Set `PROVIDER_OVERRIDE_LAMBDA=asf` when starting LocalStack and let us know if you experience any issues! Starting with LocalStack 2.0 the current Lambda implementation will be deprecated in favor of this new provider. +For more information about behavioral changes, please consult the [Lambda Behavioral Changes]({{< ref "references/lambda-asf-provider" >}}) page. {{< /alert >}} @@ -24,7 +25,7 @@ LocalStack allows you to execute your Lambda functions locally, without the need LocalStack's Lambda support is available via two providers, the old one and our new and more stable provider (labeled `asf` after our new internal service framework). Set the `PROVIDER_OVERRIDE_LAMBDA` variable to switch between the two providers, e.g. `PROVIDER_OVERRIDE_LAMBDA=asf`. -By default LocalStack sill uses the old provider. +By default LocalStack still uses the old provider. With LocalStack v2.0, this will be changed to ASF, but the old provider will still be available, in case you need some additional time to migrate. This fallback option will then be removed in further releases. diff --git a/content/en/user-guide/tools/lambda-tools/hot-swapping/index.md b/content/en/user-guide/tools/lambda-tools/hot-swapping/index.md index 8802876cde..700338a351 100644 --- a/content/en/user-guide/tools/lambda-tools/hot-swapping/index.md +++ b/content/en/user-guide/tools/lambda-tools/hot-swapping/index.md @@ -21,6 +21,7 @@ This way, any saved change inside your source file directly affects the already ## Covered Topics +[Using the new Lambda provider](#using-the-new-lambda-provider): [Application Configuration Examples](#application-configuration-examples): * [Code hot-swapping for JVM Lambdas](#code-hot-swapping-for-jvm-lambdas) * [Code hot-swapping for Python Lambdas](#code-hot-swapping-for-python-lambdas) @@ -33,6 +34,12 @@ This way, any saved change inside your source file directly affects the already [Useful Links](#useful-links) +## Using the new Lambda provider +When using the new Lambda provider, hot-reloading does not conflict with fast execution times, and it is not needed to spawn a new container for every invocation. +Also, hot reloading for Lambda layers (Pro) is now supported, it works identical to functions, but only 1 layer is allowed per function if hot-reloading is active in the layer. + +For more information about behavioral changes, please consult the [Lambda Behavioral Changes]({{< ref "references/lambda-asf-provider" >}}) page. + ## Application Configuration Examples ### Code hot-swapping for JVM Lambdas From 4da8ff9dcd0c236d6acd315755dede04f7aba3de Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Fri, 23 Dec 2022 15:42:32 +0100 Subject: [PATCH 13/13] clarify truncate stdout limit --- content/en/references/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/references/configuration.md b/content/en/references/configuration.md index c82cf95b7c..80216e3bd4 100644 --- a/content/en/references/configuration.md +++ b/content/en/references/configuration.md @@ -143,7 +143,7 @@ While the ElasticSearch API is actively maintained, the configuration variables | Variable| Example Values | Description | | - | - | - | -| `LAMBDA_TRUNCATE_STDOUT` | `2000` (default) | Allows increasing the default char value for truncation of lambda logs.| +| `LAMBDA_TRUNCATE_STDOUT` | `2000` (default) | Allows increasing the default char limit for truncation of lambda log lines when printed in the console.| | `BUCKET_MARKER_LOCAL` | `hot-reload` (default) | Optional bucket name for running lambdas locally.| | `LAMBDA_DOCKER_NETWORK` | | Optional Docker network for the container running your lambda function. This configuration value also applies to ECS containers. Needs to be set to the network the LocalStack container is connected to if not default bridge network. | | `LAMBDA_DOCKER_FLAGS` | `-e KEY=VALUE`, `-v host:container`, `-p host:container`, `--add-host domain:ip` | Additional flags passed to Lambda Docker `run`\|`create` commands (e.g., useful for specifying custom volume mounts). Does only support environment, volume, port and add-host flags |