Comments (8)
Hi @fmuracciole, the final aliased Lambda has to be warmed, because otherwise a different instance of the lambda would be spun up, and then the aliased one.
So imo pinging a different qualifier (like $LATEST
) which is natively deployed by Serverless first will not have any effect, because the alias plugin creates a new version.
The alias option in the warmup plugin is very important, because the CW event that runs the warmup has to trigger the correct alias that is deployed.
I need to have a look at the prewarm
option. Maybe it is possible to add some handling either in the alias plugin or in the warmup plugin to make them run better.
Can you additionally check if the order of the plugins in serverless.yml matches the one described in my README? Just to be sure ;-)
BTW: We also use both plugins at work, but I'm sure not with prewarm.
from serverless-aws-alias.
Thanks for your quick response,
I've respected the order you said in the README :
I'm using java lambdas with serverless 1.21.1
`frameworkVersion: ">=1.12.0 <2.0.0"
plugins:
- serverless-plugin-warmup
- serverless-aws-alias
`
The warmup lambda is created, invocations are made at the beginning BUT i can't see any schedule trigger on it ... maybe a warmup bug.
I understand the problem of differents versions warmed, but a call to a specific version is not possible ? i.e. the future one , instead of calling the alias ?
from serverless-aws-alias.
Ok. now I got it. I'll have to check the warmup plugin. In case of prewarm
it should call the (not yet aliased but already deployed) new function version instead of the alias (which would trigger the old one) once, to warm it up. Afterwards the alias plugin will switch the alias to the new version.
As I see it, this can be only fixed in the warmup plugin, so that SERVERLESS_ALIAS
is used as is to configure the CW rules correctly, but only during deployment (when the prewarm action in the plugin is started) it should use the function version from Serverless.
I'll try to get a fix ready for the warmup plugin (maybe tomorrow or on Friday). Do you know if there is already an issue opened there?
from serverless-aws-alias.
Great ! 👍
No issue opened yet for the warmup plugin
from serverless-aws-alias.
Sorry that there was no action here yet - I was quite loaded with work the last days. I will take care of this later this week.
from serverless-aws-alias.
I found the issue. For the prewarmup ping the warmup plugin uses process.env.SERVERLESS_ALIAS
. This environment variable is currently only set in the AWS environment (function environment) but not in the Serverless process while deploying.
const params = {
FunctionName: this.warmup.name,
InvocationType: 'RequestResponse',
LogType: 'None',
Qualifier: process.env.SERVERLESS_ALIAS || '$LATEST',
Payload: JSON.stringify({ source: 'serverless-plugin-warmup' })
}
return this.provider.request('Lambda', 'invoke', params)
...
I'll provide a fix here, because otherwise the warmup plugin had to access the alias option which it should not be aware of semantically.
from serverless-aws-alias.
Released with 1.5.1
from serverless-aws-alias.
Thanks a lot for the fix !
from serverless-aws-alias.
Related Issues (20)
- [/Resources/TOPIC_NAME/DependsOn/0] 'null' values are not allowed in templates
- TypeError : Cannot read property "Properties" of undefined HOT 4
- Log to CloudWatch Logs: LogGroup name not reflecting Alias HOT 1
- ServerlessError: Export 'project-name-ServerlessAliasReference' does not exist. HOT 19
- aliasStage (throttlingRateLimit, throttlingBurstLimit) setting has no effect HOT 1
- Domain manager support is not working since serverless-domain-manager 3.1.0-beta.0
- No alias is created when the serverless-plugin-split-stacks plugin is also used HOT 2
- When using an existing API Gateway, the APIs created are not pointing to the alias
- Deploy region china HOT 2
- Invalid tag when deploying masterAlias HOT 4
- Alias not applied to event bridge events
- Error: The API doesn't include a resource HOT 5
- Is there any way that we can seperate the stage name and alias name. HOT 1
- How to spec alias name on yml file
- Build fails: Export 'projectName-stageName-ServerlessAliasReference' does not exist HOT 11
- Serverless command "alias remove" not found
- TypeError: this.aliasStackGetAliasStackNames(...).mapSeries is not a function HOT 1
- Deploy produces an error: cannot find module '../lib/plugins/aws/lib/monitorStack' HOT 6
- npm serverless-aws-alias-v3 issue - Not attaching all used dependencies in build
- Is there a plan to support alias traffic weighting feature?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-aws-alias.