Hi, I can add http event to a Lambda function to have an API gateway createed, but now I want to create a Cloudfront distribution which uses the methods of that API gateway. In my cloudfront, how do I refer to the API gateway which is implicitly created for the Lambda functions?
I got a snippet to describe the origin from here:
http://forum.serverless.com/t/use-cloudfront-proxy-to-access-lambda-apis/357
But that’s not doing it for me so far I’m getting: An error occurred while provisioning your stack: CloudFrontDistribution - One or more of your origins do not exist…
"DomainName" : {
"Fn::Join": [
"",
[
{ "Ref": "ApiGatewayRestApi" },
".execute-api.${self:provider.region}.amazonaws.com"
]
]
}