I want to deploy Lambda + API-gateway + CloudFront through serverless framework.
Lambda and API-gateway can be deployed by defining function in serverless.yml and for CloudFront I define resources.
However, for CloudFront, I had to define DomainName attribute which should be filled with API-gateway endpoint that is not yet deployed.
Resources:
ApiDistribution:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
Origins:
- Id: ApiGateway
DomainName: "api-gateway endpoint"
As the result, I have to follow the steps.
- Deploy
Lambda+API-gateway. - Check
API-gatewayendpoint. - Add
CloudFrontresource intoserverless.ymlwithDominNameattribute pointing toAPI-gatewayendpoint. - Deploy
CloudFront.
Is there any way to deploy all(CloudFront + API-gateway + Lambda) at a time?
(But I don't want to give API-gateway DNS)