AWS PublishVersion与无服务器

发布于 2025-02-04 10:41:59 字数 443 浏览 4 评论 0原文

我有一个相当大的项目,我使用Windows终端使用无服务器框架将其部署到AWS(一次合在一起)。

我会这样做:

serverless deploy -s integration

这将占用我所有的lambdas并部署它们。我的问题是我需要使用AWS的版本操作,并且我不知道该怎么做。

进行无服务器部署后,我是否需要打开AWS CLI控制台并为我已经使用无服务器部署的每个Lambda运行类似的操作?

version=$(aws lambda publish-version --function-name test_lambda --description "updated via cli" --region eu-west-1| jq '.Version')

我只是对如何结合部署Lambdas的两种方式感到困惑。

I have a pretty big project that I use Serverless Framework to deploy to AWS (a few lambdas together at a time) using Windows Terminal.

I would do:

serverless deploy -s integration

and it will take all of my lambdas and deploy them. My problem is that I need to use the versioning of AWS, and I don't know how to do it.

After I do the serverless deploy, do I need to open the AWS CLI console and run something like this for each lambda that I already deployed using serverless?

version=$(aws lambda publish-version --function-name test_lambda --description "updated via cli" --region eu-west-1| jq '.Version')

I'm just confused on how to combine the 2 ways of deploying lambdas.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

养猫人 2025-02-11 10:42:00

默认情况下,使用无服务器框架部署的所有功能均已版本。您还可以通过设置将其禁用或明确打开:

provider:
  versionFunctions: true (or false to turn it off)

请记住,旧版本不会自动删除,因此,如果您要保留一些先前部署的版本,则可能需要使用插件为 https://github.com/claygregory/serverless/serverless-prune-plugin-plugin

by default, all functions deployed with Serverless Framework are versioned. You can also disable it or turn it on explicitly by setting:

provider:
  versionFunctions: true (or false to turn it off)

Please keep in mind that the old versions are not removed automatically, so if you want to keep e.g. only a few previously deployed versions, you might need to use a plugin as https://github.com/claygregory/serverless-prune-plugin

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文