# How to create aliases for lambda functions and stages in API gateway using serverless?

**URL:** <https://forum.serverless.com/t/how-to-create-aliases-for-lambda-functions-and-stages-in-api-gateway-using-serverless/1662>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [April 7, 2017, 1:54pm UTC](https://forum.serverless.com/t/how-to-create-aliases-for-lambda-functions-and-stages-in-api-gateway-using-serverless/1662 "2017-04-07T13:54:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdrnaik24](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@kdrnaik24](https://forum.serverless.com/u/kdrnaik24)\
**Post date:** [April 7, 2017, 1:54pm UTC](https://forum.serverless.com/t/how-to-create-aliases-for-lambda-functions-and-stages-in-api-gateway-using-serverless/1662/1 "2017-04-07T13:54:41Z")

</div>

I am trying to deploy lambda function, written in java, using serverless framework. But I am not getting how to create aliases for lambda function and different stages in API gateway using sererless.yml file.

I have mentioned aliases in my serverless.yml file.

**part of serverless.yml:**

functions:  
hello:  
handler: com.serverless.Handler

```
events:
  - http: 
      path: service
      method: post 
   
aliases:
   - FirstFunction

```

Still, It’s not working. Even I tried **serverless deploy --alias myAlias** command as mentioned on this page [https://www.npmjs.com/package/serverless-aws-alias](https://www.npmjs.com/package/serverless-aws-alias)

Can anyone tell me, how to create **aliases for lambda function** and **stages in API Gateway?**

---

<div class="post-metadata">

**Author:** ![triqi](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/triqi/32/1106_2.png) [@triqi](https://forum.serverless.com/u/triqi)\
**Post date:** [October 3, 2017, 7:10am UTC](https://forum.serverless.com/t/how-to-create-aliases-for-lambda-functions-and-stages-in-api-gateway-using-serverless/1662/2 "2017-10-03T07:10:09Z")

</div>

I know this is quite an old question, and I hope you have figured it out already. In case you haven’t, what you’re missing is including the [plugin](https://serverless.com/framework/docs/providers/aws/guide/plugins/) in your YAML file.

```
// serverless.yml
...
plugins:
  - serverless-aws-alias

...

```

You do not need the **aliases** property and it should be removed.
