# Set Api Gateway stage variable?

**URL:** <https://forum.serverless.com/t/set-api-gateway-stage-variable/1080>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [January 6, 2017, 5:35pm UTC](https://forum.serverless.com/t/set-api-gateway-stage-variable/1080 "2017-01-06T17:35:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![camhart](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@camhart](https://forum.serverless.com/u/camhart)\
**Post date:** [January 6, 2017, 5:35pm UTC](https://forum.serverless.com/t/set-api-gateway-stage-variable/1080/1 "2017-01-06T17:35:37Z")

</div>

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.

 ![](https://canada1.discourse-cdn.com/flex036/uploads/serverless/original/1X/2d00e39f89b93592993e3cf35bd907b1eec14cbc.png)

I’m almost certain it can be done by creating a [AWS::ApiGateway::Stage - AWS CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html) 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!

---

<div class="post-metadata">

**Author:** ![camhart](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@camhart](https://forum.serverless.com/u/camhart)\
**Post date:** [January 12, 2017, 7:18pm UTC](https://forum.serverless.com/t/set-api-gateway-stage-variable/1080/2 "2017-01-12T19:18:00Z")

</div>

Edit: Found a plugin [https://github.com/svdgraaf/serverless-plugin-stage-variables](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](https://github.com/paulSambolin/serverless-enable-api-logs/pull/4)  
Fork: [https://github.com/camhart/serverless-enable-api-logs](https://github.com/camhart/serverless-enable-api-logs)

From [README.md](http://README.md)

# Usage

```auto
...

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

```
