Whitelist path based lambda routing


I have a CDN which acts as a proxy in case the file is not found in cache, forwards the request to API Gateway and then to a lambda function to retrieve the file from S3.

I was wondering what’s the best way to allow access only to certain url paths? The whitelist should be dynamic.

For example:

Custom API Gateway authoriser?