Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make deployment callable from other scripts with callback #3

Merged
merged 2 commits into from Feb 10, 2016

Conversation

fivethreeo
Copy link
Contributor

Example:

gulp.task('deploy_resource', function () {

    var format = require('string-format');
    var deploy = require(path.join(
      __dirname,
      'node_modules',
      'cfn-elasticsearch-domain',
      'node_modules',
      'cfn-lambda',
      'deploy'));

    return deploy(
      'eu-west-1', ['eu-west-1'], function (res) {
          console.log(format(res, 'eu-west-1'));
      }
    );
});

@bendavis78
Copy link

+1 - Better yet, why not export the deploy function in the top-level module?

gulp.task('deploy_resource', function() {
    var deploy = require('cfn-lambda').deploy;
    return deploy(...);
});

@fivethreeo
Copy link
Contributor Author

Top level would make it impossible to use more than one cfn. If so it would need a module arg.

@fivethreeo
Copy link
Contributor Author

Both the

"cfn-lambda-deploy": "node ./node_modules/cfn-lambda/deploy.js"

and

    var cfnlambda = require('cfn-lambda');
    var config = require('./config.json');
    var format = require('string-format');

    return cfnlambda.deploy(
      'cfn-elasticsearch-domain',
      'eu-west-1',
      ['eu-west-1'],
      function (res) {
          console.log(format(res, 'eu-west-1'));
      }
    );

Methods work.

andrew-templeton added a commit that referenced this pull request Feb 10, 2016
make deployment callable from other scripts with callback
@andrew-templeton andrew-templeton merged commit 73d58e2 into andrew-templeton:master Feb 10, 2016
@andrew-templeton
Copy link
Owner

If I drop a PR, comment again like this - I have over 25 public projects I'm sole contrib on and ~100 others I get notifs for. Chances are I liked your PR and just forgot about it :)

Thank you much for the commits! Really good stuff / +1

@fivethreeo
Copy link
Contributor Author

Thank you :) This module really makes cfn lamdas easy. But could you do a new release in the npm registry? npm just wants to pull the one on there.

@andrew-templeton
Copy link
Owner

Going to release tonight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants