packages/iam/src/cli/create-policy.js
function executeCommand(parameters) {
    const configFilePath = path.join(process.cwd(), plugin.config.policiesPath);
    return mkdirpAsync(configFilePath)
    .then(() => {
      // We create the configuration file of the Lambda
      const document = {
        Version: '2012-10-17',
        Statement: [{
          Effect: 'Deny',
          Action: ['*'],
          Resource: ['*']
        }]
      };

      // We save the specification in a json file
      return fs.writeFileAsync(configFilePath + path.sep + parameters.identifier + '.json', JSON.stringify(document, null, 2));
    })
    .then(() => {
      const msg = '\n  The IAM policy ' + icli.format.info(parameters.identifier)
                + ' has been created in ' + icli.format.info(configFilePath + path.sep + parameters.identifier + '.json') + '\n\n';
      icli.print(msg);
    });
  }
function executeCommand(parameters) {
    const configFilePath = path.join(process.cwd(), plugin.config.policiesPath);
    return mkdirpAsync(configFilePath)
    .then(() => {
      // We create the configuration file of the Lambda
      const document = {
        Version: '2012-10-17',
        Statement: [{
          Effect: 'Deny',
          Action: ['*'],
          Resource: ['*']
        }]
      };

      // We save the specification in a json file
      return fs.writeFileAsync(configFilePath + path.sep + parameters.identifier + '.json', JSON.stringify(document, null, 2));
    })
    .then(() => {
      const msg = '\n  The IAM policy ' + icli.format.info(parameters.identifier)
                + ' has been created in ' + icli.format.info(configFilePath + path.sep + parameters.identifier + '.json') + '\n\n';
      icli.print(msg);
    });
  }
function executeCommand ( parameters ) { const configFilePath = path . join ( process . cwd ( ) , plugin . config . policiesPath ) ; return mkdirpAsync ( configFilePath ) . then ( ( ) => { // We create the configuration file of the Lambda const document = { Version : '2012-10-17' , Statement : [ { Effect : 'Deny' , Action : [ '*' ] , Resource : [ '*' ] } ] } ; // We save the specification in a json file return fs . writeFileAsync ( configFilePath + path . sep + parameters . identifier + '.json' , JSON . stringify ( document , null , 2 ) ) ; } ) . then ( ( ) => { const msg = '\n  The IAM policy ' + icli . format . info ( parameters . identifier ) + ' has been created in ' + icli . format . info ( configFilePath + path . sep + parameters . identifier + '.json' ) + '\n\n' ; icli . print ( msg ) ; } ) ; }
Create the new policy
@param {Object} parameters - the parameters provided in the command and in the prompt
@returns {Promise<null>} - The execution stops here
Create the new policy