serverless-aws-alias-example
serverless-aws-alias-example copied to clipboard
Issues while using serverless-aws-alias
trafficstars
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?