hyperbrain / serverless-aws-alias-example Goto Github PK
View Code? Open in Web Editor NEWExample project for the Serverless alias plugin
License: MIT License
Example project for the Serverless alias plugin
License: MIT License
@HyperBrain Thanks for the plugin.
I see that you had mentioned this plugin wouldn't work with the PR that enables reusing existing API GW's across multiple sls stacks.
Do you plan on updating the plugin to support that model anytime soon? Also, do you have any short-term recommendations or workarounds in the interim?
Hi @HyperBrain
Context: I am trying to use serverless-aws-alias package to use it as a plugin and deploy 2 stages as versions (v1,v2) as aliases.
First of all, if I try to start the server by doing sls offline by using serverless-aws-alias, it throws the following error:
Error:
Error: Cannot find module '/home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/lib/plugins/aws/lib/monitorStack'
Require stack:
- /home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless-aws-alias/index.js
- /home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/lib/utils/require-with-import-fallback.js
- /home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/lib/classes/plugin-manager.js
- /home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/lib/serverless.js
- /home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/scripts/serverless.js
- /home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/bin/serverless.js
- /home/ashwin/.nvm/versions/node/v16.15.1/lib/node_modules/serverless/bin/serverless.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue (/home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
at Function.Module._resolveFilename (/home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/tsconfig-paths/src/register.ts:90:36)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at new AwsAlias (/home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless-aws-alias/index.js:43:24)
at PluginManager.addPlugin (/home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/lib/classes/plugin-manager.js:91:28)
at /home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/lib/classes/plugin-manager.js:137:69
at Array.forEach (<anonymous>)
at PluginManager.loadAllPlugins (/home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/lib/classes/plugin-manager.js:137:44)
at async Serverless.init (/home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/lib/serverless.js:146:5)
at async /home/ashwin/Documents/sls-playground/serverless-hello-world/node_modules/serverless/scripts/serverless.js:614:7
Instead of the above plugin, If I use serverless-aws-alias-v3 plugin, I was able to start the server. And I am able to deploy the first version (v1). However, when I try to deploy v2, it says "Another resource with the same parent already exists". How to deploy multiple stages in AWS API gateway through this plugin? How to mitigate this?
Can you share any working examples?
When I try to update my alias with follow command:
node ./node_modules/serverless/bin/serverless deploy --alias uat
My CF stack update fail with follow error:
21:21:24 UTC+1300 | UPDATE_FAILED | AWS::Lambda::Version | TransactionDashapiLambdaVersionwpEeyV9wDnRLKYRD3XkwKYtOdI8WBZjxYEFe9pQ2eCw | Update to resource type AWS::Lambda::Version is not supported.
I have used above command to create the uat stage and update my function once successfully. But when I try to run the deploy command the 3rd time, this error happen. And my CF stack fail since then.
How can I fix this?
Thanks,
Hi there,
Serverless version: 1.17
For some reason I am always generating the same stack no matter what Alias I put on. I followed the installation instructions and it seems the Alias plugin is giving some feedback while deploying, but its always deploying / overwriting the same content with the same endpoints
I created first the first stage deploy
serverless deploy
And then I tried to create aliases for v1
serverless deploy --alias v1
and v2
serverless deploy --alias v2
But I always end up overwriting the API Gateway, Lambdas and everything
POST - https://{same_endpoint}.execute-api.eu-west-1.amazonaws.com/...
Any suggestion?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.