From c52120c1261e4ac612ed95fcf9bde3eeda697f73 Mon Sep 17 00:00:00 2001 From: Anisa Oshafi Date: Wed, 26 Mar 2025 18:32:29 +0100 Subject: [PATCH 1/3] Cloudfront Lambda@Edge experimental introduction --- content/en/user-guide/aws/cloudfront/index.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/content/en/user-guide/aws/cloudfront/index.md b/content/en/user-guide/aws/cloudfront/index.md index 641a9dfb6c..68dcf022da 100644 --- a/content/en/user-guide/aws/cloudfront/index.md +++ b/content/en/user-guide/aws/cloudfront/index.md @@ -56,6 +56,26 @@ This can occur because different operating systems adopt diverse DNS caching str Typically, after a few retries, the command should succeed. It's worth noting that similar behavior can be observed in the actual AWS environment, where CloudFront DNS names may take up to 10-15 minutes to propagate across the network. +## Lambda@Edge + +{{< callout "note">}} +We’re introducing an early, incomplete, and experimental feature that emulates AWS CloudFront Lambda@Edge. + +This feature is still under development, and functionality is limited. +{{< /callout >}} + +You can enable this feature by setting `CLOUDFRONT_LAMBDA_EDGE=1` in your LocalStack configuration. + +### Current features include +- Support for [`CreateDistribution`](https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CreateDistribution.html) API to set up CloudFront distributions with Lambda@Edge. +- Support for modifying request and response headers dynamically. + +### Known limitations +- The [`UpdateDistribution`](https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html), [`DeleteDistribution`](https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_DeleteDistribution.html), and [`Persistence Restore`](https://docs.localstack.cloud/user-guide/state-management/persistence/) features are not yet supported for Lambda@Edge. +- Lack of full support for `viewer-request` and `viewer-response` event types. + Please expect inconsistencies and missing functionality. +- [`IncludeBody`](https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_LambdaFunctionAssociation.html#cloudfront-Type-LambdaFunctionAssociation-IncludeBody) option is currently not supported. + ## Using custom URLs LocalStack Pro supports using an alternate domain name, also referred to as a `CNAME` or custom domain name, to access your applications and file artifacts instead of relying on the domain name generated by CloudFront for your distribution. From ee14f7e552f6ff078e23e1c67a7b031262fc2ec9 Mon Sep 17 00:00:00 2001 From: Anisa Oshafi Date: Thu, 27 Mar 2025 11:09:33 +0100 Subject: [PATCH 2/3] Mention version --- content/en/user-guide/aws/cloudfront/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/user-guide/aws/cloudfront/index.md b/content/en/user-guide/aws/cloudfront/index.md index 68dcf022da..37a609357d 100644 --- a/content/en/user-guide/aws/cloudfront/index.md +++ b/content/en/user-guide/aws/cloudfront/index.md @@ -59,14 +59,14 @@ It's worth noting that similar behavior can be observed in the actual AWS enviro ## Lambda@Edge {{< callout "note">}} -We’re introducing an early, incomplete, and experimental feature that emulates AWS CloudFront Lambda@Edge. +We’re introducing an early, incomplete, and experimental feature that emulates AWS CloudFront Lambda@Edge, starting with version 4.3.0. This feature is still under development, and functionality is limited. {{< /callout >}} You can enable this feature by setting `CLOUDFRONT_LAMBDA_EDGE=1` in your LocalStack configuration. -### Current features include +### Current features - Support for [`CreateDistribution`](https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CreateDistribution.html) API to set up CloudFront distributions with Lambda@Edge. - Support for modifying request and response headers dynamically. From ab70a1d206935c0b877663810c278699235769fa Mon Sep 17 00:00:00 2001 From: Anisa Oshafi Date: Thu, 27 Mar 2025 11:20:50 +0100 Subject: [PATCH 3/3] Little background --- content/en/user-guide/aws/cloudfront/index.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/en/user-guide/aws/cloudfront/index.md b/content/en/user-guide/aws/cloudfront/index.md index 37a609357d..66725e7ddb 100644 --- a/content/en/user-guide/aws/cloudfront/index.md +++ b/content/en/user-guide/aws/cloudfront/index.md @@ -61,6 +61,9 @@ It's worth noting that similar behavior can be observed in the actual AWS enviro {{< callout "note">}} We’re introducing an early, incomplete, and experimental feature that emulates AWS CloudFront Lambda@Edge, starting with version 4.3.0. +It enables running Lambda functions at simulated edge locations. +This allows you to locally test and develop request/response modifications, security enhancements and more. + This feature is still under development, and functionality is limited. {{< /callout >}}