Is there an alternative to the serverless-cloudformation-changesets? for serverless version 3

546 views Asked by At

Problem

Im just trying to deploy serveless-cloudformation-changesets on AWS codebuild But the build failed because of versioning error


  Serverless Error ---------------------------------------
 
  The Serverless version (1.83.3) does not satisfy the "frameworkVersion" (3) in serverless.yml

Below details

Cause

The serveless-cloudformation-changesets depends on [email protected] https://github.com/trek10inc/serverless-cloudformation-changesets/issues/27 So executing delpoy with changesets opiton, I encounterd error

code

buildspec-changeset.yml

version: 0.2

phases:
  install:
    commands:
      - npm install -g serverless
      - npm install --save serverless-cloudformation-changesets
  pre_build:
    commands:
      - DATE=$(date "+%Y%m%d%H%M")
      - CHANGE_SET_NAME="sample_changeset_${DATE}"
  build:
    commands:
      - sls deploy --changeset $CHANGE_SET_NAME --stage $STAGE

serverless.yml


frameworkVersion: '3'

provider:
  name: aws
  runtime: python3.8
  stage: ${opt:stage, self:custom.defaultStage}
  region: ${opt:region, self:custom.defaultRegion}


error logs

[Container] 2022/12/28 08:25:08 Entering phase INSTALL
[Container] 2022/12/28 08:25:08 Running command npm install -g serverless
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731)

added 406 packages, and audited 407 packages in 19s

66 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

[Container] 2022/12/28 08:25:28 Running command serverless --version
Framework Core: 3.26.0
Plugin: 6.2.2
SDK: 4.3.2

...

[Container] 2022/12/28 08:26:07 Entering phase BUILD
[Container] 2022/12/28 08:26:07 Running command serverless --version
Running "serverless" from node_modules
Serverless: Deprecation warning: bin/serverless is deprecated, use bin/serverless.js instead
            More Info: https://www.serverless.com/framework/docs/deprecations/#BIN_SERVERLESS
Framework Core: 1.83.3 (local)
Plugin: 3.8.4
SDK: 2.3.2
Components: 2.34.9

[Container] 2022/12/28 08:26:08 Running command serverless deploy --changeset $CHANGE_SET_NAME --s $STAGE --verbose
Running "serverless" from node_modules
Serverless: Deprecation warning: bin/serverless is deprecated, use bin/serverless.js instead
            More Info: https://www.serverless.com/framework/docs/deprecations/#BIN_SERVERLESS
 
  Serverless Error ---------------------------------------
 
  The Serverless version (1.83.3) does not satisfy the "frameworkVersion" (3) in serverless.yml
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              16.15.1
     Framework Version:         1.83.3 (local)
     Plugin Version:            3.8.4
     SDK Version:               2.3.2
     Components Version:        2.34.9
 

Question

  • Is there an alternative to the serverless-cloudformation-changesets? for serverless version 3.

My Idea

  • If there wasnt an alternative, I will change serverless.yml with serverlessv2 or v1.

I checked the latest version of serveless-cloudformation-changesets. But the library has not maintained since 3 years ago. cf. https://github.com/trek10inc/serverless-cloudformation-changesets

1

There are 1 answers

2
Aaron Stuyvenberg On BEST ANSWER

I saw this bug in the morning and decided to fork serverless-cloudformation-changesets and update it for V3.

It's now published: https://www.npmjs.com/package/serverless-cloudformation-changesets-v3

It's a drop in replacement, you simply need to run serverless plugin install -n serverless-cloudformation-changesets-v3, and the rest should work.