Droplr/serverless-api-cloudfront

Allow wildcard on domain

JaderCM opened this issue · 1 comments

Hi guys, how can I reference this cloudfront distribution created by your plugin in serverless framework yaml file?

I need to reference a Lambda@Edge to this cloudfront distribution.

At moment, if I choose the value "all" for the property "headers" of your apiCloudFront custom variable, the header "Origin" from the request does not match the API Gateway endpoint and this causes the error 403 (Bad request) from Cloudfront.

So, I need to use the plugin serverless-plugin-cloudfront-lambda-edge to resolve this problem as describe here: https://github.com/silvermine/serverless-plugin-cloudfront-lambda-edge#what-is-it

But this plugin needs to reference the logical id of the Cloudfront distribution.

Looking your code, I found the logical id that you are using: ApiDistribution

Congratulations for this excellent plugin! Smart developers, smart codes.