简体   繁体   中英

How can I export the AWS API Gateway Endpoints to file (or similar) after deploying?

I am using the AWS API Gateway to mock different APIs and I want to use those endpoints in my application (which is not a lambda).

So my idea was to somehow reference those endpoints from a file like a json, but for that I need to get them exported every time I deploy.

Is there any way to archive this?

It depends on which stack you are using to deploy API gateway.

For example,

Outputs:
 myapi:
   Type: AWS::ApiGatewayV2::Api
   Properties:
     Name: MyAPI
     ProtocolType: HTTP
 APIEndpoint:
   Description: endpoint of api
   Value:
     Fn::Join:
       - ""
       - - https://
         - Ref: myapi
         - .execute-api.ap-southeast-1.amazonaws.com/
   Export:
     Name: APIEndpoint

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM