Serverless Framework - 如何将模块资源合并成云形成

Serverless Framework - How to merge module resources into cloud formation

我在将 module/awsm.json 合并到 resources-cf.json 时遇到问题。我正在尝试的任何事情都不会合并它们。这是我的步骤

  1. jaws project create
  2. cd new-project-name
  3. jaws module create greetings hello
  4. 修改 greetings/awsm.json 添加 LambdaIamPolicyDocumentStatements 和资源。类似于 https://github.com/dekz/awsm-users/blob/master/awsm.json.

"jaws deploy resources" 不更新云的形成并产生 -

JAWS: Resources Deployer  "dev": Deploying resources to region "us-west-2"...  
JAWS: Resources Deployer  "dev - us-west-2":  Performing Cloudformation     stack update.  This could take a while depending on how many resources you     are updating...  
JAWS: Resources Deployer  "dev - us-west-2":  Cloud formation stack update failed because of the following error...  
{ [ValidationError: No updates are to be performed.]
  cause: 
   { [ValidationError: No updates are to be performed.]
     message: 'No updates are to be performed.',
     code: 'ValidationError',
     time: Sun Oct 11 2015 00:13:53 GMT-0700 (MST),
     statusCode: 400,
     retryable: false,
     retryDelay: 30 },
  isOperational: true,
  code: 'ValidationError',
  time: Sun Oct 11 2015 00:13:53 GMT-0700 (MST),
  statusCode: 400,
  retryable: false,
  retryDelay: 30 }

重新部署 lambda 和端点也不会更新云形成资源。

将更改导入 resources-cf.json 并将其应用到 AWS 的正确流程是什么?

我运行在遇到类似问题时遇到了这个问题。就我而言,设置区域和阶段具体部署成功。

您确定您没有将资源部署到不同阶段 and/or 区域吗,这就是 AWS 给您验证错误的原因(即,在那个 region/stage,您的堆栈已经是最新的)?

这是我运行:

jaws deploy resources staging us-east-1

编辑我的 cloudformation/staging/us-east-1/resources-cf.json 文件后。

然后我通过 AWS Web 控制台确认更改确实生效了。

目前,在 1.3.3 上,没有像我预期的那样自动从 awsm.json 生成 resources-cf.json

来自他们的Gitter channel

resources part of awsm-module can update main resources cf file on the first install (through the post install step), but that is it for now. There is no tooling at the moment to do the same thing when you add changes to your module manually. For now such changes have to be moved by hand to the appropriate resources-cf file. Future versions of JAWS should bring support for commands that allow rebuilding resources-cf file from information stored inside the awsm-modules, as some people requested that feature.