51.2k views
1 vote
What Amazon CloudFront events can be used to trigger my functions?

User Phuc Tran
by
7.8k points

1 Answer

2 votes

Final answer:

Amazon CloudFront can trigger functions on events such as Viewer Request, Viewer Response, Origin Request, and Origin Response. Detailed information on configuring and troubleshooting function triggers can be found in the CloudFront documentation.

Step-by-step explanation:

The Amazon CloudFront service can trigger functions in response to various events. These events can be used to execute a function when a request or a response reaches CloudFront. To address the question: What Amazon CloudFront events can be used to trigger my functions? Three types of CloudFront events can trigger functions:

  • Viewer Request: This event occurs when a viewer request is received by CloudFront before it checks if the requested item is in its cache.
  • Viewer Response: This event happens after CloudFront receives a response from the origin server, but before it sends the response to the viewer.
  • Origin Request: Triggered when CloudFront forwards a request to your origin. This occurs when the requested object is not in CloudFront's cache.
  • Origin Response: Occurs after CloudFront gets a response from the origin server, but before it caches the object in response to an origin request.

It's important to review the CloudFront documentation for proper implementation and to troubleshoot and help prevent errors when configuring function triggers.

User Rocki
by
7.8k points