I have a API Gateway sitting behind CloudFront. I have a custom header called 'header1'. I want to pass its value from Postman to CloudFront to API Gateway. I have a lambda sitting behind the API Gateway and I want to use the 'header1' value inside the lambda. I created a custom header inside the origins of the distribution, but it never picks the value from Postman. It always passes the value I set up inside the CloudFront. Any help would be appreciated!
To proxy a custom request header to your origin, you need to tell CloudFront to include that header in the request CloudFront makes to your origin. You can do this using policies by either:
If the header should be included in your cache key, use a cache policy. Otherwise use an origin request policy.
Additional details here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html