🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@aws-solutions-constructs/aws-eventbridge-lambda

Package Overview
Dependencies
Maintainers
1
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-solutions-constructs/aws-eventbridge-lambda

CDK Constructs for deploying AWS Events Rule that inveokes AWS Lambda

1.119.0
Source
npm
Version published
Weekly downloads
7.4K
-2.16%
Maintainers
1
Weekly downloads
 
Created
Source

aws-eventbridge-lambda module

Stability: Experimental

All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.

Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/
LanguagePackage
Python Logo Pythonaws_solutions_constructs.aws_eventbridge_lambda
Typescript Logo Typescript@aws-solutions-constructs/aws-eventbridge-lambda
Java Logo Javasoftware.amazon.awsconstructs.services.eventbridgelambda

This AWS Solutions Construct implements an AWS EventBridge rule and an AWS Lambda function.

Here is a minimal deployable pattern definition in Typescript:

const { EventbridgeToLambdaProps, EventbridgeToLambda } from '@aws-solutions-constructs/aws-eventbridge-lambda';

const props: EventbridgeToLambdaProps = {
    lambdaFunctionProps: {
        code: lambda.Code.fromAsset(`${__dirname}/lambda`),
        runtime: lambda.Runtime.NODEJS_12_X,
        handler: 'index.handler'
    },
    eventRuleProps: {
      schedule: events.Schedule.rate(Duration.minutes(5))
    }
};

new EventbridgeToLambda(this, 'test-eventbridge-lambda', props);

Initializer

new EventbridgeToLambda(scope: Construct, id: string, props: EventbridgeToLambdaProps);

Parameters

Pattern Construct Props

NameTypeDescription
existingLambdaObj?lambda.FunctionExisting instance of Lambda Function object, providing both this and lambdaFunctionProps will cause an error.
lambdaFunctionProps?lambda.FunctionPropsUser provided props to override the default props for the Lambda function.
existingEventBusInterface?events.IEventBusOptional user-provided custom EventBus for construct to use. Providing both this and eventBusProps results an error.
eventBusProps?events.EventBusPropsOptional user-provided properties to override the default properties when creating a custom EventBus. Setting this value to {} will create a custom EventBus using all default properties. If neither this nor existingEventBusInterface is provided the construct will use the default EventBus. Providing both this and existingEventBusInterface results an error.
eventRulePropsevents.RulePropsUser provided eventRuleProps to override the defaults

Pattern Properties

NameTypeDescription
eventBusevents.IEventBusReturns the instance of events.IEventBus used by the construct
eventsRuleevents.RuleReturns an instance of events.Rule created by the construct
lambdaFunctionlambda.FunctionReturns an instance of lambda.Function created by the construct

Default settings

Out of the box implementation of the Construct without any override will set the following defaults:

Amazon EventBridge Rule

  • Grant least privilege permissions to EventBridge rule to trigger the Lambda Function

AWS Lambda Function

  • Configure limited privilege access IAM role for Lambda function
  • Enable reusing connections with Keep-Alive for NodeJs Lambda function
  • Enable X-Ray Tracing
  • Set Environment Variables
  • AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)

Architecture

Architecture Diagram

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

Keywords

aws

FAQs

Package last updated on 02 Sep 2021

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