Lambda@Edge adds support for Response Generation and Custom Logging

Posted on: Feb 8, 2017

Lambda@Edge (in preview today) allows you to run Lambda functions at the AWS Edge locations in response to CloudFront events, without provisioning or managing servers.

Today, we are excited to announce two new features, Response Generation and Custom Logging that Lambda@Edge functions will support. Using the new Response Generation feature, Lambda@Edge now allows you to write Lambda functions that can generate an HTTP response to end user requests arriving at AWS edge locations. This means you can further customize or personalize content for your end users while minimizing latency without running your own servers in AWS regions or elsewhere to generate your content. For instance, you can now redirect unauthenticated users to say a login page that you create on the fly, generate a customized error page or a static webpage directly from an edge location closest to the end user. To get started building with this Lambda@Edge feature, refer to our documentation.

In addition, your Lambda@Edge functions can now contain custom logging statements, giving you the ability to write these logs to Amazon CloudWatch to help debug and monitor your Lambda@Edge functions as they execute at edge locations in response to the four events we support – viewer request arrival, request to the origin, response from the origin and viewer response. CloudWatch logs will appear in your home Region where Lambda@Edge functions were authored. Further details on granting your function permissions to CloudWatch and the programming model are available in our documentation pages.

There are no additional charges for using these two features. To get started with these features, sign up for the Lambda@Edge Preview.