aws / aws/serverless-application-model

Feature request - Lambda alias shifting

Open
#777 8 comments 12 reactions 0 assignees View on GitHub
area/resource/function contributors/welcome maintainer/need-response type/docs type/feature
Dominant language
Python
Stars
9.6k
Forks
2.5k
Avg merge
1d 11h
Merged PRs (30d)
7

Description

This is a feature request to "do something like `AutoPublishAlias`, but better." Basically, I would like SAM to support **exactly** the process that is described in #298 and #304.

Before I actually used `AutoPublishAlias` when deploying, my mental model of how it works was just as described in those issues. I did not expect deploying a new stage would remove the previous stage alias. I'm clearly not the only one who thought so. This is also [_the_ documented](https://docs.aws.amazon.com/lambda/latest/dg/aliases-intro.html) way on how to use aliases. Absolutely *no* document I read mentioned the best practice of separating stages to stacks. Not even in [Safe Lambda deployments](https://awslabs.github.io/serverless-application-model/safe_lambda_deployments.html).

Now of course I read the detailed and helpful explanation by @jfuss on these best practices. I see the value in it. But I also think there's merit to the original, intended way of having multiple aliases pointing to different version in the same stack. [@jimcatts has a pretty convincing use case](https://github.com/awslabs/serverless-application-model/issues/304#issuecomment-451462208). I have another one - I have a hobby Alexa skill. It's really an overkill and needlessly complex to have 2 stacks (beta & prod) for an Alexa skill. I'm never going to run into the issues @jfuss mentioned are inherent in using the same stack for multiple stages.

Also, what is then the use case for `AutoPublishAlias` when the alias is pretty much always pointing to $LATEST. Or am I missing something?

So I would ask the following:
1) Please update the documentation with best practices around multi-stage deployments, use of `AutoPublishAlias` where it's clearly mentioned it removes the "previous" alias, etc.
2) Please consider making the functionality mentioned above into a feature.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.