1 Answer
- Newest
- Most votes
- Most comments
0
Hello,
CloudFront doesn't invoke edge functions for viewer response events when the origin returns HTTP status code 400 or higher [1].
Lambda@Edge functions for origin response events are invoked for all origin responses, including when the origin returns HTTP status code 400 or higher. Hence, you can use Lambda@Edge function at the origin response for your requirement [2].
References :
answered 10 months ago
Relevant content
- AWS OFFICIALUpdated 6 months ago

With test event, the code is behaving as expected.