Lambda Version Alias
This example provides house alias routing can be used in API Gateway and in Kinesis Streams (lambda event mapping to alias)
High level Steps
- The solution has “src” and “templates”. src has the java sample lambda. templates have the .tf files.
- Upon “mvn clean package” “target” folder will have the jar generated.
- “exec.sh” has the aws cli/bash commands to deploy the lambda function and modify the alias accordingly
- Initial Setup
- Build java source
- Run terraform templates to create API Gateway/Lambda. This pushes the above jar to the lambda
- Created API points to lambda:active alias. “red” and “black” aliases are also created at this point
- Modify the code
- Run the “exec.sh”. This is similar to GIT pipelines deploying the function
- At this point the the cli sets current version as red and new code being deployed as black
- cli sets the routing pointing to black and additional routing config weightage for the fallback/red