Package: aws-solutions-constructs.aws-s3-lambda
aws-s3-lambda module---Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/LanguagePackagePythonaws_solutions_constructs.aws_s3_lambdaTypescript@aws-solutions-constructs/aws-s3-lambdaJavasoftware.amazon.awsconstructs.services.s3lambdaOverviewThis AWS Solutions Construct implements an Amazon S3 bucket connected to an AWS Lambda function.Here is a minimal deployable pattern definition:Typescriptimport{Construct}from'constructs';import{Stack,StackProps}from'aws-cdk-lib';import*aslambdafrom"aws-cdk-lib/aws-lambda";import{S3ToLambdaProps,S3ToLambda}from'@aws-solutions-constructs/aws-s3-lambda';newS3ToLambda(this,'test-s3-lambda',{lambdaFunctionProps:{code:lambda.Code.fromAsset(`lambda`),runtime:lambda.Runtime.NODEJS_16_X,handler:'index.handler'},});Pythonfromaws_solutions_constructs.aws_s3_lambdaimportS3ToLambdafromaws_cdkimport(aws_lambdaas_lambda,Stack)fromconstructsimportConstructS3ToLambda(self,'test_s3_lambda',lambda_function_props=_lambda.FunctionProps(code=_lambda.Code.from_asset('lambda'),runtime=_lambda.Runtime.PYTHON_3_9,handler='index.handler'))Javaimportsoftware.constructs.Construct;importsoftware.amazon.awscdk.Stack;importsoftware.amazon.awscdk.StackProps;importsoftware.amazon.awscdk.services.lambda.*;importsoftware.amazon.awscdk.services.lambda.Runtime;importsoftware.amazon.awsconstructs.services.s3lambda.*;newS3ToLambda(this,"test-s3-lambda'",newS3ToLambdaProps.Builder().lambdaFunctionProps(newFunctionProps.Builder().runtime(Runtime.NODEJS_16_X).code(Code.fromAsset("lambda")).handler("index.handler").build()).build());Pattern Construct PropsNameTypeDescriptionexistingLambdaObj?lambda.FunctionExisting instance of Lambda Function object, providing both this andlambdaFunctionPropswill cause an error.lambdaFunctionProps?lambda.FunctionPropsOptional user provided props to override the default props for the Lambda function.existingBucketObj?s3.BucketExisting instance of S3 Bucket object. If this is provided, then also providing bucketProps is an error.bucketProps?s3.BucketPropsOptional user provided props to override the default props for the S3 Bucket.s3EventSourceProps?S3EventSourcePropsOptional user provided props to override the default props for S3EventSourcePropsloggingBucketProps?s3.BucketPropsOptional user provided props to override the default props for the S3 Logging Bucket.logS3AccessLogs?booleanWhether to turn on Access Logging for the S3 bucket. Creates an S3 bucket with associated storage costs for the logs. Enabling Access Logging is a best practice. default - truePattern PropertiesNameTypeDescriptionlambdaFunctionlambda.FunctionReturns an instance of the lambda.Function created by the constructs3Bucket?s3.BucketReturns an instance of the s3.Bucket created by the constructs3LoggingBucket?s3.BucketReturns an instance of s3.Bucket created by the construct as the logging bucket for the primary bucket.s3BucketInterfaces3.IBucketReturns an instance of s3.IBucket created by the constructDefault settingsOut of the box implementation of the Construct without any override will set the following defaults:Amazon S3 BucketConfigure Access logging for S3 BucketEnable server-side encryption for S3 Bucket using AWS managed KMS KeyEnforce encryption of data in transitTurn on the versioning for S3 BucketDon't allow public access for S3 BucketRetain the S3 Bucket when deleting the CloudFormation stackApplies Lifecycle rule to move noncurrent object versions to Glacier storage after 90 daysAWS 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.