AWS S3 - Check Custom Headers

0

Hi all,

We are using a CDN which isn't CloudFront and we are working on integrating it with S3. The CDN is adding some custom headers (for example: **distribution-id **) that we want to check on the S3 side. so the question is, there is way to check for custom headers in the bucket policy, for example allowing only Get Operations if the request has a specific header ? or there is a way to check for custom headers using S3 Access Points/Lambda Object Access Point or anything else the same way We do with Lambda@Edge when using CloudFront ??

Thanks in advance

1 Answer
0

You can leverage the event context in your Lambda function used for the S3 object Lambda access points. If you look at the userRequest field under the event context, there is a key called headers that includes A map of string to strings containing the HTTP headers and their values from the original call, excluding any authorization-related headers. If the same header appears multiple times, the values from each instance of the same header are combined into a comma-delimited list. The case of the original headers is retained in this map.

AWS
Taka_M
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions