Reputation: 7709
I have a AWS Serverless Application Model (SAM) template in which I define an API implicit by defining events at the Functions (as described here).
Now I want to use the API Gateway in a CloudFront Distribution. For this I normally would use Ref and Fn::GetAtt to get the attributes of the API. But since it is not explicitly defined, I do not know what to "Ref".
Is there a way? or do I have to define the API explicitly?
Upvotes: 1
Views: 630
Reputation: 497
An implicit API is given the name ServerlessRestApi
. I haven't yet tried to use !Ref
or !GetAtt
with the implicit API resource, but I would assume that it would be possible as it works with other generated resources.
Here is a link to the GitHub docs that discuss the implicit API resources: https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
Upvotes: 3