AWS recently released Versioning and Aliases for Lambda Functions. I'm going to outline how I've taken advantage of this to provide environmentally-aware Lambda function configurations in Python.
AWS Lambda doesn't currently support environment variables, so 12-factor-style configuration isn't an option. I'll be using seprate config files for each environment.
We're making two assumptions for this article:
- I've already created an AWS Lambda function with the following aliases:
- Dev
- Test
- Staging
- Production