Get started with Lambda@Edge functions (console) (original) (raw)
With Lambda@Edge, you can use CloudFront triggers to invoke a Lambda function. When you associate a CloudFront distribution with a Lambda function, CloudFront intercepts requests and responses at CloudFront edge locations and runs the function. Lambda functions can improve security or customize information close to your viewers to improve performance.
The following list provides a basic overview of how to create and use Lambda functions with CloudFront.
Overview: Creating and using Lambda functions with CloudFront
- Create a Lambda function in the US East (N. Virginia) Region.
- Save and publish a numbered version of the function.
If you want to change the function, you must edit the $LATEST version of the function in the US East (N. Virginia) Region. Then, before you set it up to work with CloudFront, you publish a new numbered version. - Associate the function with a CloudFront distribution and cache behavior. Then specify one or more CloudFront events (triggers) that cause the function to execute. For example, you can create a trigger for the function to execute when CloudFront receives a request from a viewer.
- When you create a trigger, Lambda creates replicas of the function at AWS locations around the world.
Tip
For a step-by-step tutorial, see the following topic:
Topics
Ways to use Lambda@Edge
Tutorial: Basic Lambda@Edge function
Did this page help you? - Yes
Thanks for letting us know we're doing a good job!
If you've got a moment, please tell us what we did right so we can do more of it.
Did this page help you? - No
Thanks for letting us know this page needs work. We're sorry we let you down.
If you've got a moment, please tell us how we can make the documentation better.