File tree Expand file tree Collapse file tree 5 files changed +65
-0
lines changed
Serverless/EventBridgeLambdaAndS3Example Expand file tree Collapse file tree 5 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+ <PropertyGroup >
3+ <TargetFramework >net6.0</TargetFramework >
4+ <ImplicitUsings >enable</ImplicitUsings >
5+ <Nullable >enable</Nullable >
6+ <GenerateRuntimeConfigurationFiles >true</GenerateRuntimeConfigurationFiles >
7+ <AWSProjectType >Lambda</AWSProjectType >
8+ <!-- This property makes the build directory similar to a publish directory and helps the AWS .NET Lambda Mock Test Tool find project dependencies. -->
9+ <CopyLocalLockFileAssemblies >true</CopyLocalLockFileAssemblies >
10+ <!-- Generate ready to run images during publishing to improve cold start time. -->
11+ <PublishReadyToRun >true</PublishReadyToRun >
12+ </PropertyGroup >
13+ <ItemGroup >
14+ <PackageReference Include =" Amazon.Lambda.CloudWatchEvents" Version =" 4.3.0" />
15+ <PackageReference Include =" Amazon.Lambda.Core" Version =" 2.1.0" />
16+ <PackageReference Include =" Amazon.Lambda.Serialization.SystemTextJson" Version =" 2.3.1" />
17+ </ItemGroup >
18+ </Project >
Original file line number Diff line number Diff line change 1+ {
2+ "source" : [" aws.s3" ],
3+ "detail-type" : [" Object Created" ],
4+ "detail" : {
5+ "bucket" : {
6+ "name" : [" eventbridge-lambda-and-s3-example" ]
7+ }
8+ }
9+ }
10+
Original file line number Diff line number Diff line change 1+ using Amazon . Lambda . Core ;
2+ using Amazon . Lambda . CloudWatchEvents . S3Events ;
3+ using System . Text . Json ;
4+ // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class.
5+ [ assembly: LambdaSerializer ( typeof ( Amazon . Lambda . Serialization . SystemTextJson . DefaultLambdaJsonSerializer ) ) ]
6+
7+ namespace EventBridgeLambdaAndS3Example ;
8+
9+ public class Function
10+ {
11+ public void FunctionHandler ( S3ObjectCreateEvent s3ObjectCreateEvent , ILambdaContext context )
12+ {
13+ context . Logger . LogLine ( "S3 Object Create Event Received" ) ;
14+ context . Logger . LogLine ( JsonSerializer . Serialize ( s3ObjectCreateEvent ) ) ;
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ # Event-driven .NET applications with AWS Lambda and Amazon EventBridge
2+
3+ This is a companion project to a forthcoming blog post on using Amazon EventBridge with an AWS Lambda function.
4+
5+ This readme will be updated to link to the blog post soon.
Original file line number Diff line number Diff line change 1+ {
2+ "Information" : [
3+ " This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI." ,
4+ " To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory." ,
5+ " dotnet lambda help" ,
6+ " All the command line options for the Lambda command can be specified in this file."
7+ ],
8+ "profile" : " " ,
9+ "region" : " " ,
10+ "configuration" : " Release" ,
11+ "function-architecture" : " x86_64" ,
12+ "function-runtime" : " dotnet6" ,
13+ "function-memory-size" : 256 ,
14+ "function-timeout" : 30 ,
15+ "function-handler" : " EventBridgeLambdaAndS3Example::EventBridgeLambdaAndS3Example.Function::FunctionHandler"
16+ }
You can’t perform that action at this time.
0 commit comments