Package: aws-solutions-constructs.aws-lambda-kinesis-streams
aws-lambda-kinesisstreams module---Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/LanguagePackagePythonaws_solutions_constructs.aws_lambda_kinesis_streamTypescript@aws-solutions-constructs/aws-lambda-kinesisstreamsJavasoftware.amazon.awsconstructs.services.lambdakinesisstreamsOverviewThis AWS Solutions Construct deploys an AWS Lambda Function that can put records on an Amazon Kinesis Data Stream.Here is a minimal deployable pattern definition:Typescriptimport{Construct}from'constructs';import{Stack,StackProps}from'aws-cdk-lib';import{LambdaToKinesisStreamsProps}from'@aws-solutions-constructs/aws-lambda-kinesisstreams';import*aslambdafrom'aws-cdk-lib/aws-lambda';newLambdaToKinesisStreams(this,'LambdaToKinesisStreams',{lambdaFunctionProps:{runtime:lambda.Runtime.NODEJS_18_X,handler:'index.handler',code:lambda.Code.fromAsset(`lambda`)}});Pythonfromaws_solutions_constructs.aws_lambda_kinesis_streamimportLambdaToKinesisStreamsfromaws_cdkimport(aws_lambdaas_lambda,aws_kinesisaskinesis,Stack)fromconstructsimportConstructLambdaToKinesisStreams(self,'LambdaToKinesisStreams',lambda_function_props=_lambda.FunctionProps(runtime=_lambda.Runtime.PYTHON_3_9,handler='index.handler',code=_lambda.Code.from_asset('lambda')))Javaimportsoftware.constructs.Construct;importsoftware.amazon.awscdk.Stack;importsoftware.amazon.awscdk.StackProps;importsoftware.amazon.awscdk.services.lambda.*;importsoftware.amazon.awscdk.services.lambda.eventsources.*;importsoftware.amazon.awscdk.services.lambda.Runtime;importsoftware.amazon.awsconstructs.services.lambdakinesisstreams.*;newLambdaToKinesisStreams(this,"LambdaToKinesisStreams",newLambdaToKinesisStreamsProps.Builder().lambdaFunctionProps(newFunctionProps.Builder().runtime(Runtime.NODEJS_18_X).code(Code.fromAsset("lambda")).handler("index.handler").build()).build());Pattern Construct PropsNameTypeDescriptionexistingLambdaObj?lambda.FunctionExisting instance of a Lambda Function object, providing both this andlambdaFunctionPropswill cause an error.lambdaFunctionProps?lambda.FunctionPropsUser provided props to override the default props for the Lambda Function.existingStreamObj?kinesis.StreamExisting instance of a Kinesis Data Stream, providing both this andkinesisStreamPropswill cause an error.kinesisStreamProps?kinesis.StreamPropsOptional user-provided props to override the default props for the Kinesis Data Stream.createCloudWatchAlarmsbooleanWhether to create recommended CloudWatch Alarms (defaults to true).existingVpc?ec2.IVpcAn optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for Amazon Kinesis Streams. If an existing VPC is provided, thedeployVpcproperty cannot betrue. This usesec2.IVpcto allow clients to supply VPCs that exist outside the stack using theec2.Vpc.fromLookup()method.vpcProps?ec2.VpcPropsOptional user-provided properties to override the default properties for the new VPC.enableDnsHostnames,enableDnsSupport,natGatewaysandsubnetConfigurationare set by the pattern, so any values for those properties supplied here will be overridden. IfdeployVpcis nottruethen this property will be ignored.deployVpc?booleanWhether to create a new VPC based onvpcPropsinto which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern:One isolated subnet in each Availability Zone used by the CDK programenableDnsHostnamesandenableDnsSupportwill both be set to trueIf this property istruethenexistingVpccannot be specified. Defaults tofalse.streamEnvironmentVariableName?stringOptional Name to override the Lambda Function default environment variable name that holds the Kinesis Data Stream name value. Default: KINESIS_DATASTREAM_NAMEPattern PropertiesNameTypeDescriptionlambdaFunctionlambda.FunctionReturns an instance of the Lambda Function.kinesisStreamkinesis.StreamReturns an instance of the Kinesis Data Stream.cloudwatchAlarms?cloudwatch.Alarm[]Returns the CloudWatch Alarms created to monitor the Kinesis Data Stream.vpc?ec2.IVpcReturns an interface to the VPC used by the pattern (if any). This may be a VPC created by the pattern or the VPC supplied to the pattern constructor.Default settingsOut of the box implementation of the Construct without any overrides will set the following defaults:AWS Lambda FunctionMinimally-permissive IAM role for the Lambda Function to put records on the Kinesis Data StreamEnable X-Ray TracingSets an Environment Variable named KINESIS_DATASTREAM_NAME that holds the Kinesis Data Stream Name, which is a required property Kinesis Data Streams SDK when making calls to itAmazon Kinesis StreamEnable server-side encryption for the Kinesis Data Stream using AWS Managed CMKDeploy best practices CloudWatch Alarms for the Kinesis Data StreamArchitecture© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.