function buildCf(options, cmd) {
  const KesClass = utils.determineKesClass(options, Kes);
  let parentConfig;
  try {
    parentConfig = new Config(options);
  }
  catch (e) {
    return Promise.reject(e);
  }

  return buildNestedCfs(parentConfig, KesClass, options).then((config) => {
    const kes = new KesClass(config);
    switch (cmd) {
      case 'create':
        deprecate('"kes cf create" command is deprecated. Use "kes cf deploy" instead');
        return kes.createStack();
      case 'update':
        deprecate('"kes cf update" command is deprecated. Use "kes cf deploy" instead');
        return kes.updateStack();
      case 'upsert':
        deprecate('"kes cf upsert" command is deprecated. Use "kes cf deploy" instead');
        return kes.upsertStack();
      case 'deploy':
        return kes.deployStack();
      case 'validate':
        return kes.validateTemplate();
      case 'compile':
        return kes.compileCF();
      case 'delete':
        return kes.deleteStack();
      default:
        console.log('Wrong choice. Accepted arguments: [create|update|upsert|deploy|validate|compile]');
    }
  });
}
function buildCf(options, cmd) {
  const KesClass = utils.determineKesClass(options, Kes);
  let parentConfig;
  try {
    parentConfig = new Config(options);
  }
  catch (e) {
    return Promise.reject(e);
  }

  return buildNestedCfs(parentConfig, KesClass, options).then((config) => {
    const kes = new KesClass(config);
    switch (cmd) {
      case 'create':
        deprecate('"kes cf create" command is deprecated. Use "kes cf deploy" instead');
        return kes.createStack();
      case 'update':
        deprecate('"kes cf update" command is deprecated. Use "kes cf deploy" instead');
        return kes.updateStack();
      case 'upsert':
        deprecate('"kes cf upsert" command is deprecated. Use "kes cf deploy" instead');
        return kes.upsertStack();
      case 'deploy':
        return kes.deployStack();
      case 'validate':
        return kes.validateTemplate();
      case 'compile':
        return kes.compileCF();
      case 'delete':
        return kes.deleteStack();
      default:
        console.log('Wrong choice. Accepted arguments: [create|update|upsert|deploy|validate|compile]');
    }
  });
}
function buildCf ( options , cmd ) { const KesClass = utils . determineKesClass ( options , Kes ) ; let parentConfig ; try { parentConfig = new Config ( options ) ; } catch ( e ) { return Promise . reject ( e ) ; } return buildNestedCfs ( parentConfig , KesClass , options ) . then ( ( config ) => { const kes = new KesClass ( config ) ; switch ( cmd ) { case 'create' : deprecate ( '"kes cf create" command is deprecated. Use "kes cf deploy" instead' ) ; return kes . createStack ( ) ; case 'update' : deprecate ( '"kes cf update" command is deprecated. Use "kes cf deploy" instead' ) ; return kes . updateStack ( ) ; case 'upsert' : deprecate ( '"kes cf upsert" command is deprecated. Use "kes cf deploy" instead' ) ; return kes . upsertStack ( ) ; case 'deploy' : return kes . deployStack ( ) ; case 'validate' : return kes . validateTemplate ( ) ; case 'compile' : return kes . compileCF ( ) ; case 'delete' : return kes . deleteStack ( ) ; default : console . log ( 'Wrong choice. Accepted arguments: [create|update|upsert|deploy|validate|compile]' ) ; } } ) ; }
Builds, uploads and deploy a Cloudformation based on options passed
from the commander library

@param {object} options Options passed by the commander library
@param {string} cmd the argument selected in the CLI, e.g. deploy, update, etc.
@return {undefined}
Builds uploads and deploy a Cloudformation based on options passed from the commander library