Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serverless Framework - How to merge module resources into cloud formation

I'm having trouble merging my module/awsm.json into resources-cf.json. Nothing I'm trying will merge them. Here are my steps

  1. jaws project create
  2. cd new-project-name
  3. jaws module create greetings hello
  4. modify greetings/awsm.json adding LambdaIamPolicyDocumentStatements and Resources. Similar to https://github.com/dekz/awsm-users/blob/master/awsm.json.

"jaws deploy resources" does not update the cloud formation and produces -

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 }

Redeploying the lambda and endpoint does not update the cloud formation resources either.

What is the proper process to get the changes into the resources-cf.json and apply them on AWS?

like image 911
Craig Ivy Avatar asked Oct 11 '15 07:10

Craig Ivy


1 Answers

For now, on 1.3.3, there is no automation for generating resources-cf.json from the awsm.json as I expected it to be as well.

From their 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.

like image 54
smad Avatar answered Nov 16 '22 02:11

smad