Skip to content

Commit 7bc5f90

Browse files
committed
Update to warmup snapshot using new AddAWSLambdaBeforeSnapshotRequest() method
1 parent 6600990 commit 7bc5f90

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
<!-- All Microsoft Compilers packages -->
44
<DynamoDbSdkVersion>4.0.0.0</DynamoDbSdkVersion>
55
<AmazonLambdaCoreVersion>2.5.1</AmazonLambdaCoreVersion>
6+
<AmazonLambdaAspNetCoreServerHostingVersion>1.8.0</AmazonLambdaAspNetCoreServerHostingVersion>
67
<ApiGatewayEventsVersion>2.7.1</ApiGatewayEventsVersion>
78
<AmazonLambdaRuntimeSupportVersion>1.13.0</AmazonLambdaRuntimeSupportVersion>
89
<AmazonLambdaSerializationVersion>2.4.4</AmazonLambdaSerializationVersion>
910
<CloudWatchLogsSdkVersion>4.0.0.0</CloudWatchLogsSdkVersion>
10-
<XRayRecorderVersion>2.13.0</XRayRecorderVersion>
11-
<XRaySdkHandlerVersion>2.11.0</XRaySdkHandlerVersion>
11+
<XRayRecorderVersion>2.15.0</XRayRecorderVersion>
12+
<XRaySdkHandlerVersion>2.13.0</XRaySdkHandlerVersion>
1213
<OpenTelemetryExporterVersion>1.10.0</OpenTelemetryExporterVersion>
1314
</PropertyGroup>
1415
</Project>

src/NET8MinimalAPI/NET8MinimalAPI.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiBootstrap", "ApiBootstra
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csproj", "{6FD38FCF-DB5C-45B6-8DA5-50696891ED94}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C48B21C6-EDF6-4D2D-A0EA-76A9917CDC05}"
11+
ProjectSection(SolutionItems) = preProject
12+
omnisharp.json = omnisharp.json
13+
template.yaml = template.yaml
14+
EndProjectSection
15+
EndProject
1016
Global
1117
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1218
Debug|Any CPU = Debug|Any CPU

src/NET8MinimalAPISnapSnart/ApiBootstrap/ApiBootstrap.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Amazon.Lambda.AspNetCoreServer.Hosting" Version="1.7.2" />
17+
<PackageReference Include="Amazon.Lambda.AspNetCoreServer.Hosting" Version="$(AmazonLambdaAspNetCoreServerHostingVersion)" />
1818
<PackageReference Include="Amazon.Lambda.Core" Version="$(AmazonLambdaCoreVersion)" />
1919
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="$(ApiGatewayEventsVersion)" />
2020
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="$(AmazonLambdaSerializationVersion)" />

src/NET8MinimalAPISnapSnart/ApiBootstrap/Function.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Net;
4+
using System.Net.Http;
45
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Amazon.CloudWatchLogs;
@@ -28,6 +29,18 @@
2829
options.TimestampFormat = "hh:mm:ss ";
2930
});
3031

32+
33+
builder.Services.AddAWSLambdaBeforeSnapshotRequest(
34+
new HttpRequestMessage(HttpMethod.Get, $"{routePrefix}/"));
35+
builder.Services.AddAWSLambdaBeforeSnapshotRequest(
36+
new HttpRequestMessage(HttpMethod.Get, $"{routePrefix}/test-results"));
37+
builder.Services.AddAWSLambdaBeforeSnapshotRequest(
38+
new HttpRequestMessage(HttpMethod.Put, $"{routePrefix}/bad-id") { Content = null });
39+
builder.Services.AddAWSLambdaBeforeSnapshotRequest(
40+
new HttpRequestMessage(HttpMethod.Get, $"{routePrefix}/bad-id"));
41+
builder.Services.AddAWSLambdaBeforeSnapshotRequest(
42+
new HttpRequestMessage(HttpMethod.Get, $"{routePrefix}/bad-id2"));
43+
3144
var app = builder.Build();
3245

3346
var dataAccess = app.Services.GetRequiredService<ProductsDAO>();

src/NET8MinimalAPISnapSnart/Shared/Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Amazon.Lambda.AspNetCoreServer.Hosting" Version="1.7.2" />
10+
<PackageReference Include="Amazon.Lambda.AspNetCoreServer.Hosting" Version="$(AmazonLambdaAspNetCoreServerHostingVersion)" />
1111
<PackageReference Include="AWSSDK.DynamoDBv2" Version="$(DynamoDbSdkVersion)" />
1212
</ItemGroup>
1313

0 commit comments

Comments
 (0)