serverless-heaven/serverless-aws-alias

Use stage variables to specify lambda qualifier in APIG

vkkis93 opened this issue · 6 comments

On Integration request page field lambda function always has value of last deployed stage.
For Example
getUser:staging or getUser:production.
I think it should be like getUser:${functionAlias}
Where functionAlias value should be specified in stage variables tab

Good point, thank you. I will investigate the issue.

I set a stage variable SERVERLESS_ALIAS that equals the deployed stage, so if I would set it to getUser:${SERVERLESS_ALIAS} it should work.
Then you could specify that explicitly for testing.

Nevertheless, the deployed stages should call the aliased functions correctly. It is only an issue with the AWS ApiGateway testing console.

@vkkis93 This was indeed a great idea 🙌 I changed the qualifier/alias to the stage variable and tested it with two different aliases. It would be good, if you also give it a try with the alias plugin master branch.

@HyperBrain brilliant work.
Thank you.

@HyperBrain Can you create new npm package with this fix?

I will publish the fix in a few moments.