Package: aws-solutions-constructs.aws-eventbridge-lambda
aws-eventbridge-lambda module---Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/LanguagePackagePythonaws_solutions_constructs.aws_eventbridge_lambdaTypescript@aws-solutions-constructs/aws-eventbridge-lambdaJavasoftware.amazon.awsconstructs.services.eventbridgelambdaOverviewThis AWS Solutions Construct implements an AWS EventBridge rule and an AWS Lambda function.Here is a minimal deployable pattern definition:Typescriptimport{Construct}from'constructs';import{Stack,StackProps,Duration}from'aws-cdk-lib';import{EventbridgeToLambdaProps,EventbridgeToLambda}from'@aws-solutions-constructs/aws-eventbridge-lambda';import*aslambdafrom'aws-cdk-lib/aws-lambda';import*aseventsfrom'aws-cdk-lib/aws-events';constconstructProps:EventbridgeToLambdaProps={lambdaFunctionProps:{code:lambda.Code.fromAsset(`lambda`),runtime:lambda.Runtime.NODEJS_16_X,handler:'index.handler'},eventRuleProps:{schedule:events.Schedule.rate(Duration.minutes(5))}};newEventbridgeToLambda(this,'test-eventbridge-lambda',constructProps);Pythonfromaws_solutions_constructs.aws_eventbridge_lambdaimportEventbridgeToLambda,EventbridgeToLambdaPropsfromaws_cdkimport(aws_lambdaas_lambda,aws_eventsasevents,Duration,Stack)fromconstructsimportConstructEventbridgeToLambda(self,'test-eventbridge-lambda',lambda_function_props=_lambda.FunctionProps(code=_lambda.Code.from_asset('lambda'),runtime=_lambda.Runtime.PYTHON_3_9,handler='index.handler'),event_rule_props=events.RuleProps(schedule=events.Schedule.rate(Duration.minutes(5))))Javaimportsoftware.constructs.Construct;importsoftware.amazon.awscdk.Stack;importsoftware.amazon.awscdk.StackProps;importsoftware.amazon.awscdk.Duration;importsoftware.amazon.awscdk.services.events.*;importsoftware.amazon.awscdk.services.lambda.*;importsoftware.amazon.awscdk.services.lambda.Runtime;importsoftware.amazon.awsconstructs.services.eventbridgelambda.*;newEventbridgeToLambda(this,"test-eventbridge-lambda",newEventbridgeToLambdaProps.Builder().lambdaFunctionProps(newFunctionProps.Builder().runtime(Runtime.NODEJS_16_X).code(Code.fromAsset("lambda")).handler("index.handler").build()).eventRuleProps(newRuleProps.Builder().schedule(Schedule.rate(Duration.minutes(5))).build()).build());Pattern Construct PropsNameTypeDescriptionexistingLambdaObj?lambda.FunctionExisting instance of Lambda Function object, providing both this andlambdaFunctionPropswill 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 andeventBusPropsresults 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 norexistingEventBusInterfaceis provided the construct will use thedefaultEventBus. Providing both this andexistingEventBusInterfaceresults an error.eventRulePropsevents.RulePropsUser provided eventRuleProps to override the defaultsPattern PropertiesNameTypeDescriptioneventBus?events.IEventBusReturns the instance of events.IEventBus used by the constructeventsRuleevents.RuleReturns an instance of events.Rule created by the constructlambdaFunctionlambda.FunctionReturns an instance of lambda.Function created by the constructDefault settingsOut of the box implementation of the Construct without any override will set the following defaults:Amazon EventBridge RuleGrant least privilege permissions to EventBridge rule to trigger the Lambda FunctionAWS Lambda FunctionConfigure limited privilege access IAM role for Lambda functionEnable reusing connections with Keep-Alive for NodeJs Lambda functionEnable X-Ray TracingSet Environment VariablesAWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)Architecture© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.