From 5d716b5b2861f2746d69e48efdacbaaa6d8cdd57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DELAGE=20Rapha=C3=ABl?= <36408929+delager@users.noreply.github.com> Date: Tue, 11 Apr 2023 15:32:00 +0200 Subject: [PATCH] #1978 Add Secrets Manager Client (#2003) --- .../AzureIoTHub.Portal.Infrastructure.csproj | 1 + .../Startup/AWSServiceCollectionExtension.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/AzureIoTHub.Portal.Infrastructure/AzureIoTHub.Portal.Infrastructure.csproj b/src/AzureIoTHub.Portal.Infrastructure/AzureIoTHub.Portal.Infrastructure.csproj index 017cb561d..33efe0723 100644 --- a/src/AzureIoTHub.Portal.Infrastructure/AzureIoTHub.Portal.Infrastructure.csproj +++ b/src/AzureIoTHub.Portal.Infrastructure/AzureIoTHub.Portal.Infrastructure.csproj @@ -108,6 +108,7 @@ + diff --git a/src/AzureIoTHub.Portal.Infrastructure/Startup/AWSServiceCollectionExtension.cs b/src/AzureIoTHub.Portal.Infrastructure/Startup/AWSServiceCollectionExtension.cs index f0d55197f..6574c209f 100644 --- a/src/AzureIoTHub.Portal.Infrastructure/Startup/AWSServiceCollectionExtension.cs +++ b/src/AzureIoTHub.Portal.Infrastructure/Startup/AWSServiceCollectionExtension.cs @@ -6,6 +6,7 @@ namespace AzureIoTHub.Portal.Infrastructure.Startup using Amazon; using Amazon.IoT; using Amazon.IotData; + using Amazon.SecretsManager; using AzureIoTHub.Portal.Domain; using Microsoft.Extensions.DependencyInjection; @@ -31,6 +32,8 @@ private static IServiceCollection ConfigureAWSClient(this IServiceCollection ser }); }); + _ = services.AddSingleton(() => new AmazonSecretsManagerClient(configuration.AWSAccess, configuration.AWSAccessSecret, RegionEndpoint.GetBySystemName(configuration.AWSRegion))); + return services; } }