Writing and creating a Lambda@Edge function - Amazon CloudFront
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Writing and creating a Lambda@Edge function

To use Lambda@Edge, you write the code for your Lambda function, then set up Amazon Lambda to run the function based on specific CloudFront events (triggers). To set up Lambda to run your function, you use the create function option in Lambda.

You can use the Amazon console to work with Lambda functions and CloudFront triggers, or you can work with Lambda@Edge programmatically by using APIs.

  • If you use the console, be aware that you can use only the Amazon Lambda console to create Lambda functions. You can't use the Amazon CloudFront console to create a function.

  • If you want to work with Lambda@Edge programmatically, there are several resources to help you. For more information, see Creating Lambda@Edge functions and CloudFront triggers programmatically.

Note

You can use either the Amazon Lambda console or CloudFront console to add triggers for Lambda@Edge functions.