简体   繁体   English

有没有 serverless-cloudformation-changesets 的替代品? 对于无服务器版本 3

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

Problem问题

Im just trying to deploy serveless-cloudformation-changesets on AWS codebuild But the build failed because of versioning error我只是想在 AWS codebuild 上部署serveless-cloudformation-changesets但由于版本控制错误导致构建失败


  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 serverless@1.83.3 https://github.com/trek10inc/serverless-cloudformation-changesets/issues/27 So executing delpoy with changesets opiton, I encounterd error serveless-cloudformation-changesets依赖于serverless@1.83.3 https://github.com/trek10inc/serverless-cloudformation-changesets/issues/27所以用 changesets opiton 执行 delpoy,我遇到了错误

code代码

buildspec-changeset.yml 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无服务器.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 querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated superagent@7.1.6: 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?有没有 serverless-cloudformation-changesets 的替代品? for serverless version 3.对于无服务器版本 3。

My Idea我的想法

  • If there wasnt an alternative, I will change serverless.yml with serverlessv2 or v1.如果没有替代方案,我会将 serverless.yml 更改为 serverlessv2 或 v1。

I checked the latest version of serveless-cloudformation-changesets.我检查了最新版本的 serveless-cloudformation-changesets。 But the library has not maintained since 3 years ago.但是图书馆从三年前就没有维护过。 cf.比照。 https://github.com/trek10inc/serverless-cloudformation-changesets https://github.com/trek10inc/serverless-cloudformation-changesets

I saw this bug in the morning and decided to fork serverless-cloudformation-changesets and update it for V3 .我在早上看到了这个错误,并决定 fork serverless-cloudformation-changesets并将其更新为V3

It's now published: https://www.npmjs.com/package/serverless-cloudformation-changesets-v3现已发布: 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.这是一个替代品,您只需要运行serverless plugin install -n serverless-cloudformation-changesets-v3 ,rest 应该可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无服务器框架和 CloudFormation 之间的区别? - Difference between Serverless Framework and CloudFormation? 无服务器框架/Cloudformation:使用 DLQ 部署 Kinesis 触发器 - Serverless framework/Cloudformation: deploying Kinesis trigger with DLQ 如何通过 cloudformation 在 sagemaker 中创建无服务器端点? - how to create a serverless endpoint in sagemaker via cloudformation? 替代 Lambda 用于无服务器长时间运行的任务 - Alternative to Lambda for Serverless Long running tasks CloudFormation - 如何参考无服务器使用计划? - CloudFormation - How can I reference a serverless usage plan? 使用 CloudFormation 将 Aurora 无服务器从 MySQL 5.6 更新到 5.7 而不会丢失 - Updating an Aurora serverless from MySQL 5.6 to 5.7 with CloudFormation without loss Lambda 从 Serverless 部署 CloudFormation 时未继承权限 - Lambda not inheriting permissions while deploying CloudFormation from Serverless 如何使用无服务器框架创建 API 的新版本? - How do you create a new version of an API using serverless framework? AWS Lambda 无服务器项目的 NodeJS 版本 14 和 15 之间的斗争 - Struggle between NodeJS version 14 and 15 for AWS Lambda serverless Project 将无服务器中的 AWS Lambda 事件配置应用于特定的 Lambda 版本? - Apply AWS Lambda Event configuration in Serverless to specific Lambda version?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM