Why you should not use Lambda aliases to define environments
Blog post from Octopus Deploy
Serverless application development has been simplified by tools like Serverless and AWS SAM, but transitioning to multi-environment deployments introduces complexities, particularly when using AWS Lambda aliases. Lambda aliases, which are named versions of a Lambda deployment, can define environments by pointing to specific versions of a Lambda function. However, this approach can lead to challenges in managing non-functional requirements such as security and performance, as it requires environmental awareness to shift from infrastructure to code. This can complicate security rules, as the same Lambda function may operate in both test and production contexts, necessitating measures to ensure proper data access and logging practices. Instead, using independent CloudFormation stacks, AWS regions, or separate AWS accounts for different environments is recommended, as these methods provide clearer boundaries and enhance security and monitoring reliability. Octopus facilitates managing multi-environment deployments by scoping variables to the chosen environment strategy, ensuring easier and more reliable deployments.