Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pulumi/aws-serverless

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pulumi/aws-serverless

Pulumi Amazon Web Services (AWS) Serverless Components.

  • 0.15.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Build Status

Pulumi Amazon Web Services (AWS) Serverless Components

Pulumi's framework for creating easy but powerful serverless components.

This package is meant for use with the Pulumi CLI. Please visit pulumi.io for installation instructions.

The AWS Serverless package is in very early preview, but will soon offer event sources from any AWS resource that may trigger a Lambda event, and permits you to subscribe to these events in an idiomatic JavaScript style.

Installing

This package is available in JavaScript/TypeScript for use with Node.js. Install it using either npm:

$ npm install @pulumi/aws-serverless

or yarn:

$ yarn add @pulumi/aws-serverless

Concepts

This package provides libraries to simply subscribe to many AWS events and to execute AWS lambdas in response to them. For example, bucket.onPut/onDelete/onEvent allows you to run an AWS lambda in response to the corresponding bucket event that is subscribed to.

All subscriptions allow the client to pass a preferred function.Handler instance to run when the subscription fires. This Handler can either be an AWS aws.lambda.Function instance (available through the @pulumi/aws library), or it can be an actual JavaScript/TypeScript function object (provided it has the right signature).

In the former case, the aws.lambda.Function resource can be one that the program has defined itself. Or it can just be a reference to an existing AWS Lambda that already exists in the client's cloud infrastructure.

In the latter case, the JavaScript/TypeScript function will be analyzed and 'serialized' out into a form suitable for use by an AWS Lambda that Pulumi will then create on behalf of the program. This can greatly simplify defining cloud callbacks for AWS events by avoiding needing to manually construct and maintain the AWS Lambda yourself independently of the main cloud application.

For example, a new handler for an S3 bucket's PUT event can be subscribed simply by doing the following:

const bucket = aws.s3.Bucket.get("my-bucket");
serverless.bucket.onPut("test", bucket, async (event) => {
    // Lambda's code goes here...
});

In this example, we're looking up an existing bucket using the get method, but we could have created one just as well.

Reference

For detailed reference documentation, please visit the API docs.

Keywords

FAQs

Package last updated on 11 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc