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

Serverless 2.0 support

Open nason opened this issue 3 years ago • 4 comments

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 ⚠️

nason avatar Feb 23 '21 03:02 nason

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')) {

danmaas avatar Apr 29 '21 05:04 danmaas

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

dnascimento avatar Jun 12 '21 02:06 dnascimento

any update on this?

Nicoowr avatar Oct 13 '21 16:10 Nicoowr

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

Nicoowr avatar Oct 13 '21 16:10 Nicoowr