How to use @mapbox/cfn-config - 1 common examples

To help you get started, we’ve selected a few @mapbox/cfn-config 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 mapbox / DEPRECATED-lambda-cfn / lib / cli.js View on Github external
function main(parsed, callback) {

  if (parsed.command === 'init') {
    lambdaCfn.init(parsed.environment, function(err, data) {
      if (err) return callback({message: err});
      return callback(null, data);
    });
  } else {

    // Setup commands, make sure that CLI request uses a valid command
    let available = cfnConfig.commands(parsed.options);

    if (!available[parsed.command]) {
      return callback({ message: 'Error: invalid command\n\n' + parsed.help });
    }

    // Check for valid environment
    if (!parsed.environment) {
      return callback({ message: 'Error: missing environment\n\n' + parsed.help });
    }

    // Check for template path on create and update
    if (/create|update/.test(parsed.command) && !parsed.templatePath) {
      return callback({ message: 'Error: missing templatePath\n\n' + parsed.help });
    }

    // Set the arguments for the command that will run

@mapbox/cfn-config

Quickly configure and start AWS CloudFormation stacks

BSD-2-Clause
Latest version published 7 months ago

Package Health Score

70 / 100
Full package analysis

Popular @mapbox/cfn-config functions

Similar packages