CDK Constructs for deploying AWS Events Rule that inveokes AWS Lambda
Project description
aws-eventbridge-lambda module
---Reference Documentation: | https://docs.aws.amazon.com/solutions/latest/constructs/ |
---|
Language | Package |
---|---|
Python | aws_solutions_constructs.aws_eventbridge_lambda |
Typescript | @aws-solutions-constructs/aws-eventbridge-lambda |
Java | software.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_14_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
- scope
Construct
- id
string
- props
EventbridgeToLambdaProps
Pattern Construct Props
Name | Type | Description |
---|---|---|
existingLambdaObj? | lambda.Function |
Existing instance of Lambda Function object, providing both this and lambdaFunctionProps will cause an error. |
lambdaFunctionProps? | lambda.FunctionProps |
User provided props to override the default props for the Lambda function. |
existingEventBusInterface? | events.IEventBus |
Optional user-provided custom EventBus for construct to use. Providing both this and eventBusProps results an error. |
eventBusProps? | events.EventBusProps |
Optional 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. |
eventRuleProps | events.RuleProps |
User provided eventRuleProps to override the defaults |
Pattern Properties
Name | Type | Description |
---|---|---|
eventBus? | events.IEventBus |
Returns the instance of events.IEventBus used by the construct |
eventsRule | events.Rule |
Returns an instance of events.Rule created by the construct |
lambdaFunction | lambda.Function |
Returns 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
© Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for aws-solutions-constructs.aws-eventbridge-lambda-1.145.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0110c503c04546cfef5454bca0a4f9996e5978e15724f44eb02c3a2f457b3b29 |
|
MD5 | 05af6e081785c9ec79fcc29c238f8030 |
|
BLAKE2b-256 | 2e3a452b2a56cbf99fdcfde2855874aa9ff01f150a886f1f8ea19f2475190810 |
Close
Hashes for aws_solutions_constructs.aws_eventbridge_lambda-1.145.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d1b0a27056202a0e6d30449469e358760d8781ed06b5dcf87091157796ceb6c |
|
MD5 | f198ac32b2719fc78f83924592564a5c |
|
BLAKE2b-256 | d4f18db1bbfde2fd388eb5b3e45a0cd8a261b64955f2e148e601f6ef53fc8c2a |