How to export API-URL in serverless,yml

Hi,
I have defined an API-Gateway within serverless.yml and now I want to export its url in output section of the yml file. I just wonder how to do that. I expect somethin like but this does not work due to the !ref commands which are unknown to serverless. any help would be appreciated
resources:
Outputs:
ApiUrl:
Description: URL of your API endpoint
Value: !Join
- ‘’
- - https://
- {self:custom.service.name} - '.execute-api.' - 'eu-central-1' - '.amazonaws.com/' - {self:provider.stage}

I wrote about this in How do I get my API Gateway URL?. Just copy the snippet at the bottom of that article.

Thank you so much. In the meantime I found the solution by myself :slight_smile:

1 Like

Serverless has ServiceEndpoint created already to export across stacks this try this below to export them:

Outputs:
    ServiceEndpoint:
      Export:
        Name: API-Endpoint