Set Api Gateway stage variable?

Is there any way possible to set API Gateway stage variables as seen in the image below? These are essentially to mimic configuration settings that don’t require redeployments.

I’m almost certain it can be done by creating a AWS::ApiGateway::Stage - AWS CloudFormation resource in the custom resources section. I’m not opposed to doing that I just want to make sure there isn’t some hidden plugin or feature that’s not documented (atleast so far as I could find).

Thanks!

1 Like

Edit: Found a plugin https://github.com/svdgraaf/serverless-plugin-stage-variables


I forked an existing plugin, and added a PR to the original plugin to add stage variable support.

Pull request off original plugin: https://github.com/paulSambolin/serverless-enable-api-logs/pull/4
Fork: https://github.com/camhart/serverless-enable-api-logs

From README.md

Usage

...

custom:
  stageVariables:
    thirdPartyEndpoint: http://supercool.endpoint.com/openapi/something


plugins:
  - serverless-enable-api-logs

...

functions:
  get:
    handler: index.handler
    events:
      - http:
          path: user/{id}
          method: get