user3684747
user3684747

Reputation: 311

How to set API Gateway Description in serverless.yml?

I'm trying to set the description to a REST API Gateway through serverless.yml, using serverless version 2.72.3

I couldn't find anything here https://www.serverless.com/framework/docs/providers/aws/events/apigateway

I've also tried:

provider:
  apiGateway:
    description: Your custom description

but nothing happens after deploying to AWS, the description is not changing (other changes are working)

EDIT: Thanks to Albert Marrero answer I now understand why it isn't working, but not how to make it work. Attached Screenshot to clarify which description I'd like to change (API Gateway description, not stage description)

enter image description here

Upvotes: 1

Views: 625

Answers (2)

hoangdv
hoangdv

Reputation: 16127

You have to define ApiGatewayRestApi resource by your self (Ref), then you can add description.

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

And remember to update provider to use your defined api gateway if you already config http event for some lambda functions

List of ApiGateway properties

Upvotes: 2

Bert Cafecito
Bert Cafecito

Reputation: 212

According to this guide, this setting for the description for the API Gateway stage deployment. Check your description in each of your stages

Upvotes: 1

Related Questions