How to use the serverless.yml function in serverless

To help you get started, we’ve selected a few serverless examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github danilop / ServerlessByDesign / src / engines / servfrmwk.js View on Github external
var node = model.nodes[id];
    renderingRules[node.type].resource(status, node);
  }

  console.log(template); // Still in JSON
  console.log(JSON.stringify(template, null, 4)); // JSON -> text

  for (var r in template.Resources) {
    console.log(r + " -> YAML");
    console.log(jsyaml.safeDump(template.Resources[r], { lineWidth: 1024 }));
  }

  // Line breaks can introduce YAML syntax (e.g. >-) that will put some variables
  // (e.g. AWS::Region) between quotes.
  // Single quotes must be removed for functions (e.g. Fn::GetAtt) to work.
  files['serverless.yml'] = jsyaml.safeDump(template, { lineWidth: 1024 }).replace(/'(!.+)'/g, "$1");
  
  return files;
}
github danilop / ServerlessByDesign / www / bundle.js View on Github external
var node = model.nodes[id];
    renderingRules[node.type].resource(status, node);
  }

  console.log(template); // Still in JSON
  console.log(JSON.stringify(template, null, 4)); // JSON -> text

  for (var r in template.Resources) {
    console.log(r + " -> YAML");
    console.log(jsyaml.safeDump(template.Resources[r], { lineWidth: 1024 }));
  }

  // Line breaks can introduce YAML syntax (e.g. >-) that will put some variables
  // (e.g. AWS::Region) between quotes.
  // Single quotes must be removed for functions (e.g. Fn::GetAtt) to work.
  files['serverless.yml'] = jsyaml.safeDump(template, { lineWidth: 1024 }).replace(/'(!.+)'/g, "$1");
  
  return files;
}

serverless

Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more

MIT
Latest version published 6 months ago

Package Health Score

87 / 100
Full package analysis

Popular serverless functions