簡體   English   中英

如何在serverless.yml中設置API Gateway Description?

[英]How to set API Gateway Description in serverless.yml?

我正在嘗試通過 serverless.yml 將描述設置為 REST API 網關,使用無服務器版本 2.72.3

我在這里找不到任何東西https://www.serverless.com/framework/docs/providers/aws/events/apigateway

我也試過:

provider:
  apiGateway:
    description: Your custom description

但在部署到 AWS 后沒有任何反應,描述沒有改變(其他改變有效)

編輯:感謝Albert Marrero 的回答,我現在明白為什么它不起作用,但不知道如何讓它起作用。 附上截圖以闡明我想更改的描述(API 網關描述,而不是階段描述)

在此處輸入圖像描述

根據本指南,此設置描述為 API Gateway 階段部署。 檢查您在每個階段的描述

你必須自己定義ApiGatewayRestApi資源( Ref ),然后你可以添加描述。

provider:
  apiGateway:
    RestApiId:
      Ref: MyApiGateway
    RestApiRootResourceId:
      Fn::GetAtt:
        - MyApiGateway
        - RootResourceId

resources:
  Resources:
    MyApiGateway:
      Type: AWS::ApiGateway::RestApi
      Properties:
        Name: my-api-gateway
        Description: My api gateway description # Put your description

如果您已經為某些 lambda 函數配置了 http 事件,請記住更新provider以使用您定義的 api 網關

ApiGateway 屬性列表

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM