Code Monkey home page Code Monkey logo

eventbridge-sam-example's Introduction

EventBridge Lambda-to-Lambda example

This example SAM application creates two Lambda functions, called invoiceService and orderService. It creates a rule that listens for events and routes to the target, invoiceService.

When the orderService function is invoked, it puts a event onto the EventBridge default event bus. This then invokes the invoiceService target.

Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the AWS Pricing page for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.

.
├── README.MD                   <-- This instructions file
├── invoiceService              <-- Source code for a lambda function
│   └── app.js                  <-- Main Lambda handler
├── orderService                <-- Source code for a lambda function
│   └── app.js                  <-- Main Lambda handler
│   └── package.json            <-- NodeJS dependencies and scripts
├── template.yaml               <-- SAM template

Requirements

Installation Instructions

  1. Create an AWS account if you do not already have one and login.

  2. From the command line, run:

sam build
sam deploy --guided

During the guided SAM process, choose the AWS Region where you want to install this application, and allow the permissions required to complete the installation.

How it works

When the orderFunction service is executed, it sends an event to the default event bus. This event is evaluated by a event rule created by the application. It then triggers the target Lambda function, invoiceFunction.

The purpose of this application is to show how two separate Lambda functions can interact using an event bus, without direct invocation.

==============================================

Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: MIT-0

eventbridge-sam-example's People

Contributors

jbesw avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.