Skip to main content

Posts

Showing posts from October, 2019

Serve and Process S3 Objects Request via CloudFront & Lambda@Edge.

Serve and Authenticate S3 Objects Request via CloudFront & Lambda@Edge: Use Case :  Need to check if the Requester of a S3 object has the right permissions to access the requesting object. Solution : Create s3 bucket and associate cloudFront distribution with it.  Create a lambda with your code. In lambda you can handle your object authentication request or check if the right person is accessing the right object. Add cloudfront event to the Lambda@Edge function.  Deploy Lambda@Edge function.  Select your CloudFront distribution and cloudFront event as Viewer Request (It caches request). Keep rest as default.  Now every request you make to your CloudFront will be monitored by Lambda function.