File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed
test/test-applications/integrations/Samples.Amazon.Lambda.RuntimeSupport Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 3131 "IncludeOnlyTargetFrameworks" : [" net462" ]
3232 }]
3333 },
34+ {
35+ "IntegrationName" : " AwsLambda" ,
36+ "SampleProjectName" : " Samples.Amazon.Lambda.RuntimeSupport" ,
37+ "NugetPackageSearchName" : " Amazon.Lambda.RuntimeSupport" ,
38+ "MinVersion" : " 1.0.0" ,
39+ "MaxVersionExclusive" : " 1.*.*" ,
40+ "SpecificVersions" : [
41+ " 1.*.*"
42+ ],
43+ "VersionConditions" : [{
44+ "MinVersion" : " 1.0.0" ,
45+ "IncludeOnlyTargetFrameworks" : [" net6.0" ]
46+ }]
47+ },
3448 {
3549 "IntegrationName" : " AwsSqs" ,
3650 "SampleProjectName" : " Samples.AWS.SQS" ,
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ static IntegrationMap()
3535 NugetPackages . Add ( "AerospikeClient" , new [ ] { "Aerospike.Client" } ) ;
3636 NugetPackages . Add ( "Microsoft.AspNetCore.Http" , new string [ ] { } ) ;
3737 NugetPackages . Add ( "System.Web.Mvc" , new [ ] { "Microsoft.AspNet.Mvc" } ) ;
38+ NugetPackages . Add ( "Amazon.Lambda.RuntimeSupport" , new [ ] { "Amazon.Lambda.RuntimeSupport" } ) ;
3839 NugetPackages . Add ( "AWSSDK.DynamoDBv2" , new [ ] { "AWSSDK.DynamoDBv2" } ) ;
3940 NugetPackages . Add ( "AWSSDK.Core" , new [ ] { "AWSSDK.Core" } ) ;
4041 NugetPackages . Add ( "AWSSDK.Kinesis" , new [ ] { "AWSSDK.Kinesis" } ) ;
Original file line number Diff line number Diff line change 1+ using Amazon . Lambda . Core ;
2+ using Amazon . Lambda . RuntimeSupport ;
3+ using Amazon . Lambda . Serialization . SystemTextJson ;
4+
5+ // The function handler that will be called for each Lambda event
6+ var handler = ( string input , ILambdaContext context ) =>
7+ {
8+ return input . ToUpper ( ) ;
9+ } ;
10+
11+ // Build the Lambda runtime client passing in the handler to call for each
12+ // event and the JSON serializer to use for translating Lambda JSON documents
13+ // to .NET types.
14+ await LambdaBootstrapBuilder . Create ( handler , new DefaultLambdaJsonSerializer ( ) )
15+ . Build ( )
16+ . RunAsync ( ) ;
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+ <PropertyGroup >
3+ <OutputType >Exe</OutputType >
4+ <TargetFramework >net6.0</TargetFramework >
5+ <ImplicitUsings >enable</ImplicitUsings >
6+ <Nullable >enable</Nullable >
7+ <GenerateRuntimeConfigurationFiles >true</GenerateRuntimeConfigurationFiles >
8+ <AWSProjectType >Lambda</AWSProjectType >
9+ <!-- This property makes the build directory similar to a publish directory and helps the AWS .NET Lambda Mock Test Tool find project dependencies. -->
10+ <CopyLocalLockFileAssemblies >true</CopyLocalLockFileAssemblies >
11+ <!-- Generate ready to run images during publishing to improve cold start time. -->
12+ <PublishReadyToRun >true</PublishReadyToRun >
13+ <RequiresDockerDependency >true</RequiresDockerDependency >
14+ <ApiVersion Condition =" '$(ApiVersion)' == ''" >1.8.7</ApiVersion >
15+
16+ </PropertyGroup >
17+ <ItemGroup >
18+ <PackageReference Include =" Amazon.Lambda.RuntimeSupport" Version =" $(ApiVersion)" />
19+ <PackageReference Include =" Amazon.Lambda.Core" Version =" 2.1.0" />
20+ <PackageReference Include =" Amazon.Lambda.Serialization.SystemTextJson" Version =" 2.3.1" />
21+ </ItemGroup >
22+ </Project >
You can’t perform that action at this time.
0 commit comments