Lambda with alias does not get triggered as intended
See original GitHub issueHello - This is a nifty plugin, thanks for that!
What
I have recently configured this plugin on my lambda which uses an alias to point at the latest deployed version. I would like to have the warmup plugin keep the lambda function version warm which was configured behind that alias (at any given time).
How it’s implemented?
-
My lambda is deployed and latest deployment is pointing to an alias :live
-
Here is the warmup settings in
serverless.yml
custom:
warmup:
events:
- schedule: cron(0/5 8-18 ? * MON-FRI *)
name: lambda-warmer
concurrency: 1
prewarm: true
vpc: false
functions:
<function-name>:
warmup:
name: <function's logical name>:live
enabled: true
Behaviour Observed
- Warmup plugin is doing its job finely, so I can see a dedicated CloudWatch log group is updating every 5 mins with the warmup call logs.
- However, when the real client application invokes the same lambda (with alias :live), AWS does not want to reuse the warmed-up container of that lambda instead it is creating a new lambda container (new CloudWatch log group) hindering the very basic premise of pre-warming it.
Please suggest.
Cheers, ram
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Lambda function aliases - AWS Documentation
You can create one or more aliases for your Lambda function. A Lambda alias is like a pointer to a specific function version....
Read more >AWS CloudWatch Rules fail to trigger lambda functions after ...
I want to make the alias of an AWS lambda function point to another version. Since I can't find how to update an...
Read more >SNS Topic Subscription does not trigger Lambda function if a ...
When passing the ARN of a specific lambda function version or alias to the endpoint parameter of the aws_sns_topic_subscription - the function ...
Read more >Why you should not use Lambda aliases to define environments
In this post, we'll take a look at Lambda aliases, and highlight some of the pitfalls that may not be immediately obvious when...
Read more >Serverless AWS alias plugin
This plugin enables use of AWS aliases on Lambda functions. The term alias must not be mistaken as the stage. Aliases can be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The name prop is only usable in the service level and it’s the name given to the actual warmer function, not the name of the function to warm up.
The solution, I just realized, is not documented. It uses the You can pass the alias to warmup using the environment variable
SERVERLESS_ALIAS
. The warmer will use that alias for all the functions to warm up. If you want different aliases for different functions, you need to wait for version 5 which supports multiple warmers.Yes, I have.
It has some breaking changes so look at the readme for the migration guide. It has some very useful extra functionality.