serverless-heaven / serverless-aws-alias

Alias support for Serverless 1.x
MIT License
189 stars 68 forks source link

Serverless 2.0 support #203

Open nason opened 3 years ago

nason commented 3 years ago

I've been running into issues with this plugin as I upgrade the serverless and nodejs versions for my projects.

When I tried to use the latest serverless (2.25.2) and Node LTS 14.15.0, I started getting errors like:

  TypeError: this.aliasStackGetAliasStackNames(...).mapSeries is not a function
      at AwsAlias.aliasStackLoadAliasTemplates (/project/node_modules/serverless-aws-alias/lib/stackInformation.js:82:4)
      at AwsAlias.tryCatcher (/project/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/project/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/project/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromiseCtx (/project/node_modules/bluebird/js/release/promise.js:641:10)
      at _drainQueueStep (/project/node_modules/bluebird/js/release/async.js:97:12)
      at _drainQueue (/project/node_modules/bluebird/js/release/async.js:86:9)
      at Async._drainQueues (/project/node_modules/bluebird/js/release/async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (/project/node_modules/bluebird/js/release/async.js:15:14)
      at processImmediate (internal/timers.js:461:21)

I started down the path of getting through that, and think I fixed it in https://github.com/serverless-heaven/serverless-aws-alias/commit/0872d2ea2bf2f78e66c7faaea50d0ef24a50e6ca, but then went further and migrated to support serverless 2.0.

The tests pass, and I'm going to give my fork a spin -- not sure if I went too far with this PR, I'd be happy to remove the 2.0 commit ⚠️

danmaas commented 3 years ago

One more thing I noticed, as of serverless 2.38, the config provider.role has now become provider.iam.role.

So in lib/stackops/lambdaRole.js line 18:

    if (_.has(this._serverless.service.provider, 'role')) {

needs to become

    if (_.has(this._serverless.service.provider, 'iam.role')) {
dnascimento commented 3 years ago

@nason this is great! Could you update this PR and release a new version of this plugin for framework 2?

Nicoowr commented 3 years ago

any update on this?

Nicoowr commented 3 years ago

It feels like this package is deprecated since Serverless v3 is already announced :/