diff --git a/.github/actions/deploy/action.yml b/.github/actions/deploy/action.yml index 7d89c22..2d38587 100644 --- a/.github/actions/deploy/action.yml +++ b/.github/actions/deploy/action.yml @@ -27,7 +27,7 @@ runs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: "8.0.x" + dotnet-version: "10.0.x" - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v3 diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index ea118d1..37ec9f6 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -10,7 +10,7 @@ runs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: "8.0.x" + dotnet-version: "10.0.x" - name: Restore dependencies shell: bash diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml index dc5dfb4..e0f85e9 100644 --- a/.github/actions/validate/action.yml +++ b/.github/actions/validate/action.yml @@ -6,7 +6,7 @@ runs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: "8.0.x" + dotnet-version: "10.0.x" - name: Build functions shell: bash diff --git a/.github/workflows/build-prerelease-version.yml b/.github/workflows/build-prerelease-version.yml index 10a390c..044a400 100644 --- a/.github/workflows/build-prerelease-version.yml +++ b/.github/workflows/build-prerelease-version.yml @@ -36,7 +36,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: "8.0.x" + dotnet-version: "10.0.x" - name: Restore dependencies run: dotnet restore Lho.Lambda.slnx diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index e44ad6d..1c092b3 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -42,7 +42,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: "8.0.x" + dotnet-version: "10.0.x" - name: Restore dependencies run: dotnet restore Lho.Lambda.slnx diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a148e4..fe46e38 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: "8.0.x" + dotnet-version: "10.0.x" - name: Restore dependencies run: dotnet restore Lho.Lambda.slnx diff --git a/src/Lho.Lambda.Authorizer/Lho.Lambda.Authorizer.csproj b/src/Lho.Lambda.Authorizer/Lho.Lambda.Authorizer.csproj index 6695c29..e6c17dc 100644 --- a/src/Lho.Lambda.Authorizer/Lho.Lambda.Authorizer.csproj +++ b/src/Lho.Lambda.Authorizer/Lho.Lambda.Authorizer.csproj @@ -1,6 +1,6 @@ - net8.0 + net10.0 true true diff --git a/src/Lho.Lambda.Local/Lho.Lambda.Local.csproj b/src/Lho.Lambda.Local/Lho.Lambda.Local.csproj index 59e77ef..57a1c9a 100644 --- a/src/Lho.Lambda.Local/Lho.Lambda.Local.csproj +++ b/src/Lho.Lambda.Local/Lho.Lambda.Local.csproj @@ -1,7 +1,7 @@ Exe - net8.0 + net10.0 true enable enable diff --git a/src/Lho.Lambda.Observability/Lho.Lambda.Observability.csproj b/src/Lho.Lambda.Observability/Lho.Lambda.Observability.csproj index 35db08e..3d7843e 100644 --- a/src/Lho.Lambda.Observability/Lho.Lambda.Observability.csproj +++ b/src/Lho.Lambda.Observability/Lho.Lambda.Observability.csproj @@ -1,6 +1,6 @@ - net8.0 + net10.0 true diff --git a/src/Lho.Lambda.Observability/SentryTelemetry.cs b/src/Lho.Lambda.Observability/SentryTelemetry.cs index 96e98d4..c352b60 100644 --- a/src/Lho.Lambda.Observability/SentryTelemetry.cs +++ b/src/Lho.Lambda.Observability/SentryTelemetry.cs @@ -1,11 +1,10 @@ using Amazon.Lambda.Core; -using Sentry; namespace Lho.Lambda.Observability; public static class SentryTelemetry { - private static readonly object InitLock = new(); + private static readonly Lock InitLock = new(); private static bool _initialised; public static bool Initialise(ILambdaLogger logger) diff --git a/src/Lho.Lambda.RuntimeConfiguration/Lho.Lambda.RuntimeConfiguration.csproj b/src/Lho.Lambda.RuntimeConfiguration/Lho.Lambda.RuntimeConfiguration.csproj index b606fa2..1f87b91 100644 --- a/src/Lho.Lambda.RuntimeConfiguration/Lho.Lambda.RuntimeConfiguration.csproj +++ b/src/Lho.Lambda.RuntimeConfiguration/Lho.Lambda.RuntimeConfiguration.csproj @@ -1,6 +1,6 @@ - net8.0 + net10.0 true diff --git a/src/Lho.Lambda.Tests/Lho.Lambda.Tests.csproj b/src/Lho.Lambda.Tests/Lho.Lambda.Tests.csproj index 286e64a..1403cfd 100644 --- a/src/Lho.Lambda.Tests/Lho.Lambda.Tests.csproj +++ b/src/Lho.Lambda.Tests/Lho.Lambda.Tests.csproj @@ -1,6 +1,6 @@ - net8.0 + net10.0 true enable enable diff --git a/src/Lho.Lambda/Functions/ApiFunction.cs b/src/Lho.Lambda/Functions/ApiFunction.cs index 42c2f14..0ad5ce1 100644 --- a/src/Lho.Lambda/Functions/ApiFunction.cs +++ b/src/Lho.Lambda/Functions/ApiFunction.cs @@ -210,7 +210,7 @@ private static string NormalisePath(string? rawPath) return path switch { "" => "/", - var value when value.StartsWith("/", StringComparison.Ordinal) => value, + _ when path.StartsWith("/", StringComparison.Ordinal) => path, _ => "/" + path }; } diff --git a/src/Lho.Lambda/Lho.Lambda.csproj b/src/Lho.Lambda/Lho.Lambda.csproj index cd066c0..42c0e39 100644 --- a/src/Lho.Lambda/Lho.Lambda.csproj +++ b/src/Lho.Lambda/Lho.Lambda.csproj @@ -1,6 +1,6 @@ - net8.0 + net10.0 true true diff --git a/src/Lho.Lambda/Utils/MemoryCache.cs b/src/Lho.Lambda/Utils/MemoryCache.cs index 3f5d21b..d4425ac 100644 --- a/src/Lho.Lambda/Utils/MemoryCache.cs +++ b/src/Lho.Lambda/Utils/MemoryCache.cs @@ -2,7 +2,7 @@ namespace Lho.Lambda.Utils; public class MemoryCache { - private readonly object _lock = new(); + private readonly Lock _lock = new(); private readonly Dictionary _cache = []; public T? Get(string key) diff --git a/terraform/authorizer.tf b/terraform/authorizer.tf index 31499b5..9fbf411 100644 --- a/terraform/authorizer.tf +++ b/terraform/authorizer.tf @@ -14,7 +14,7 @@ resource "aws_lambda_function" "api_authorizer" { role = aws_iam_role.lambda_exec.arn handler = "Lho.Lambda.Authorizer::Lho.Lambda.Authorizer.Functions.AuthorizerFunction::FunctionHandler" source_code_hash = data.archive_file.auth_archive.output_base64sha256 - runtime = "dotnet8" + runtime = "dotnet10" memory_size = 256 architectures = ["x86_64"] timeout = 10 @@ -29,6 +29,7 @@ resource "aws_lambda_function" "api_authorizer" { SERVICE_NAME = "now-playing" ENVIRONMENT = var.env VERSION = var.app_version + DOTNET_ROLL_FORWARD = "Major" GIT_SHA = var.git_sha SENTRY_DSN = var.sentry_dsn SENTRY_ENVIRONMENT = var.env diff --git a/terraform/lambda.tf b/terraform/lambda.tf index e756483..89049ae 100644 --- a/terraform/lambda.tf +++ b/terraform/lambda.tf @@ -33,7 +33,7 @@ resource "aws_iam_role_policy_attachment" "aws_xray_write_only_access" { resource "aws_lambda_function" "lambda" { function_name = "${var.project_name}-lambda-${var.env}" - runtime = "dotnet8" + runtime = "dotnet10" handler = "Lho.Lambda::Lho.Lambda.Functions.ApiFunction::FunctionHandler" role = aws_iam_role.lambda_exec.arn filename = "${path.module}/../lambda.zip" @@ -56,6 +56,7 @@ resource "aws_lambda_function" "lambda" { SERVICE_NAME = "now-playing" ENVIRONMENT = var.env VERSION = var.app_version + DOTNET_ROLL_FORWARD = "Major" DEPLOYED_AT = timestamp() DEPLOYED_BY = var.deployed_by GIT_SHA = var.git_sha diff --git a/terraform/main.tf b/terraform/main.tf index 1d30906..20c9c2f 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -14,7 +14,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 5.0" + version = "6.27.0" } } }