serverless-aws-alias icon indicating copy to clipboard operation
serverless-aws-alias copied to clipboard

No alias is created when the serverless-plugin-split-stacks plugin is also used

Open ziadloo opened this issue 5 years ago • 2 comments
trafficstars

I've been using the serverless-aws-alias plugin for some time now. It had its ups and downs but now I faced a problem that I cannot overcome.

My serverless project grew too big to be deployed into one CloudFormation stack (I faced the 200 resources limitation of CloudFormation). After some research, I found the serverless-plugin-split-stacks plugin. This plugin will split your stacks into nested ones. And it works on its own. But as my project uses the serverless-aws-alias plugin plugin, while I still can deploy the project without any errors reported, but the lambda functions created have no aliases created for them.

Here's a simple test case:

service: serverless-test

provider:
  name: aws
  runtime: nodejs12.x
  endpointType:                                REGIONAL

plugins:
- serverless-plugin-split-stacks
- serverless-aws-alias

custom:
  splitStacks:
    nestedStackCount: 20
    perFunction: false
    perType: false
    perGroupFunction: true

functions:
  create:
    handler: code.get
    events:
      - http:
          path: /
          integration:                           lambda
          method: get
          cors: true

If you deploy this project like this:

sls deploy --region us-east-1 --stage dev --alais dev

You'll end up with a lambda function without any aliases.

Here are my versions:

$ sls -v
Framework Core: 1.61.2
Plugin: 3.6.6
SDK: 2.3.0
Components Core: 1.1.2
Components CLI: 1.4.0

$ cat ./package.json 
{
  "name": "serverless-test",
  "version": "1.0.0",
  "description": "",
  "main": "code.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "serverless-aws-alias": "^1.8.0",
    "serverless-plugin-split-stacks": "^1.9.3"
  }
}

ziadloo avatar Apr 18 '20 14:04 ziadloo

+1 Having the same issue

vsaravind007 avatar Jul 27 '20 15:07 vsaravind007

+1 having the same issue

ydan287 avatar Nov 05 '20 11:11 ydan287