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

aws-batch-triggering-lambda

v0.8.0

Published

AWS Batch Triggering Lambda

Downloads

2

Readme

AWS Batch Triggering Lambda

Build Status codecov

Lambda to trigger AWS Batch Jobs

About

This Node Lambda is to trigger a job on AWS batch from a Lambda.

This lambda can be triggered by a standard event (from a CloudWatch cron for instance, and a lambda call) , by a kinesis message or by a SNS message.

Usage

The lambda expect the following payload:

{
  "jobDefinition": "the-job-definition",
  "jobQueue": "the-job-queue",
  "jobName": "the-job-name",
  "parameters": {
     "some": "optional parameter"
  }
}

This can be transmitted through the event, or an Kinesis/Sns event.

jobDefinition, jobQueue parameters are mandatory. parameters object is optional.

A jobName would be added based on the following logic :

  • jobName if such key exist
  • jobNamePrefix if defined followed by a date and a random string
  • jobDefinition otherwise followed by a date and a random string

For the two last option name would look like this: test-from-lambda-via-sns--2017-09-21T13-28-55--f6c83928fa175106ea35fd0ff31068e6

The lambda will respond with either an error (and reason why) or a json with the following format:

{
  "jobName": "the-job-name",
  "jobId": "b3e985b1-e02a-41c9-ac8f-4801e04c9a27-whatever"
}

Configuration

You can customize the lambda through environment variable to enable or not the supported event Sources:

  • aws:sns: SNS triggers
  • aws:kinesis: Kinesis triggers

To do so, use either AWS_BATCH_TRIGGER_ENABLE and AWS_BATCH_TRIGGER_DISABLE that accept a ; separated whitelist/blacklist.

It's also possible to restrict the jobs and/or the queue on which the job can be invocated. To do so, use the AWS_BATCH_JOB_WHITELIST and AWS_BATCH_QUEUE_WHITELIST which accept a ; separated list of pattern (without the ^ and $ at the extremities). (for instance job-queue;staging-.*queue)