serverless-components / website

:zap: Instantly deploy static website on serverless infrastructure with zero configuration using Serverless Components.
https://serverless.com
Apache License 2.0
155 stars 49 forks source link

Allow origin configuration on cloudfront #62

Closed JoaquinFernandez closed 4 years ago

JoaquinFernandez commented 4 years ago

Hi, It would be awesome to allow origin configuration for the cloudfront distribution. It is a common use case when you want to place your API under xxxxxx.yy/api. That way you could use the output from deploying an API (i.e. through express component).

Right now, in serverless service I am able to do this through this cloudformation configuration:

            DomainName:
              Fn::Join:
                - ''
                - 
                  - Ref: ApiGatewayRestApi
                  - '.execute-api.${self:provider.region}.amazonaws.com'
            OriginPath: '/${opt:stage}'
eahefnawy commented 4 years ago

If I understand this correctly, that doesn't seem related to websites and would better fit a generic cloudfront component. We wanna keep this component focused on the website use case.

JoaquinFernandez commented 4 years ago

I see, thanks!