I am currently running a static website within an S3 Bucket that re-directs to Lambda when a 404
occurs. The problem with this solution is that the Lambda function must be open it to be invoked as I cannot supply an x-api-key
header as from what I can gather the Re-routing ruleset on S3 Static Hosting do not enable headers to be attached to the request.
Essentially I am just trying to lockdown the Lambda function to only be invoked via our requests whilst sticking with the current static site-hosting routing we are using. These are the two methods I foresee to resolve this issue.
- Figure out a way to add a header to the redirect.
- Determine where the request came from and verify it prior to the lambda function running.
Any help would be greatly appreciated.