npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-aws-stepfunctions-deploy

v0.2.1

Published

A gulp task to deploy AWS Step Functions.

Downloads

20

Readme

gulp-aws-stepfunctions-deploy

Version 0.2.1

Build Status

NPM

Package version history

This package uses the aws-sdk (node).

NPM

Install

npm install gulp-aws-stepfunctions-deploy

Usage

Including + Setting Up Config

    var gulp = require('gulp');
    var aws-sf = require('gulp-aws-stepfunctions-deploy')(config);

...where config is something like...

var config = {
    accessKeyId: "YOURACCESSKEY",
    secretAccessKey: "YOUACCESSSECRET"
}

//  ...or...

var config = JSON.parse(fs.readFileSync('private/awsaccess.json'));

//  ...or to use IAM settings...

var config = { useIAM: true };

// ...or to use IAM ...

var awssf = require('gulp-aws-stepfunctions-deploy')(
    {useIAM:true},
);

// or {} / null

The optional config argument can include any option available (like region) available in the AWS Config Constructor. By default all settings are undefined.

Per AWS best practices, the recommended approach for loading credentials is to use the shared credentials file (~/.aws/credentials). You can also set the aws_access_key_id and aws_secret_access_key environment variables or specify values directly in the gulpfile via the accessKeyId and secretAccessKey options.

If you want to use an AWS profile in your ~/.aws/credentials file just set the environment variable AWS_PROFILE with your profile name before invoking your gulp task:

AWS_PROFILE=myprofile gulp upload

If you are using IAM settings, just pass the noted config ({useIAM:true}) in order to default to using IAM. More information on using IAM settings here.

Feel free to also include credentials straight into your gulpfile.js, though be careful about committing files with secret credentials in your projects!

Having AWS Key/Secrets may not be required by your AWS/IAM settings. Errors thrown by the request should give your permission errors.

Gulp Task

Create a task.

gulp.task("deploy-step-function", () => {
    return gulp.src("./dir/with/step_functions/*.json")
        .pipe(awssf({}))
    .on( "end", function() { 
            console.log('end ');
        })
    .on( "error", function( err ) {
        console.log( err );
    })

    ;
});

Step Function files

json file format following:

{
  "function_name": "step-function-parallel",
  "recreate": false,
  "role_arn" : "StatesExecutionRole-eu-west-1",
  "function_body": {
      ...
  }
}

More samples here

Options

role_arn (optional)

Type: string

Set IAM Roled under which function executes. You can either specify desired IAM Role and omit to use pre-created StatesExecutionRole-${gconfig.region}

function_name (required)

Type: string

Step Function name.

recreate (optional)

Type: bool

If set, check existence, stop all running instances and remove function with name specified, before create new one. If not set, update existent function or create if absent. Default is false.

function_body (optional)

Type: string

Function body content

Be aware that "function_name", "role_arn", "function_body" can have pieces with ES6 template string mechanism (see http://es6-features.org/#StringInterpolation). This can be used for string customization via different substituions (for instance, using Environment Variables) Sample: "role_arn" : "StatesExecutionRole-eu-${required('process').env.AWS_REGION}", Some interesting customization can be done in "function_body" as well.

gulp-aws-stepfunctions-deploy-plugin options

AWS-SDK References


License

MIT