# Stage-specific parameters?

**URL:** <https://forum.serverless.com/t/stage-specific-parameters/632>\
**Category:** Serverless Framework\
**Created:** [October 26, 2016, 4:10am UTC](https://forum.serverless.com/t/stage-specific-parameters/632 "2016-10-26T04:10:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![str3tch](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/str3tch/32/44_2.png) [@str3tch](https://forum.serverless.com/u/str3tch)\
**Post date:** [October 26, 2016, 4:54am UTC](https://forum.serverless.com/t/stage-specific-parameters/632/2 "2016-10-26T04:54:57Z")

</div>

Hey @nerdguru,

Serverless is definitely capable of this. Check out the docs on variables: [https://serverless.com/framework/docs/providers/aws/guide/variables/](https://serverless.com/framework/docs/providers/aws/guide/variables/)

here’s an example of where I am setting my CORS origins per stage:

```auto
  myLambdaFunction:
    handler: functions/myLambdaFunction/handler.handler
    events:
      - http:
          path: "v1/agents"
          method: get
          authorizer: authorization
          integration: lambda
          cors:
            origins:
              - ${self:custom.stages.${opt:stage, self:provider.stage}.vars.URL-Access-Control-Allow-Origin}
            headers:
              - Content-Type
              - X-Amz-Date
              - Authorization
              - X-Api-Key
              - X-Amz-Security-Token
            allowCredentials: true

```

hope this helps… it’s very powerful.

If you want to reference code inside your actual lambda code, you can use the `serverless-plugin-write-env-vars` plugin:

> **[silvermine/serverless-plugin-write-env-vars](https://github.com/silvermine/serverless-plugin-write-env-vars)**
>
> Contribute to silvermine/serverless-plugin-write-env-vars development by creating an account on GitHub.

cheers,  
Stretch

---

_[View the full topic](https://forum.serverless.com/t/stage-specific-parameters/632)._
