Skip to content

Commit

Permalink
EHD-1057: Simplify hosting: Code changes: Use default environment var…
Browse files Browse the repository at this point in the history
…iables for AWS credentials - so we can use EC2 instance profiles
  • Loading branch information
jamesgriff committed Jan 22, 2025
1 parent bd56fb5 commit b8dcd1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions GenderPayGap.Core/Global.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GenderPayGap.Extensions.AspNetCore;
using GenderPayGap.Extensions.AspNetCore;
using Newtonsoft.Json;

namespace GenderPayGap.Core
Expand All @@ -19,9 +19,9 @@ public static class Global
: "SslMode=Require;Trust Server Certificate=true");

public static string S3BucketName => Config.GetAppSetting("S3_BUCKET_NAME");
public static string S3BucketAwsAccessKeyId => Config.GetAppSetting("S3_BUCKET_AWS_ACCESS_KEY_ID");
public static string S3BucketAwsSecretAccessKey => Config.GetAppSetting("S3_BUCKET_AWS_SECRET_ACCESS_KEY");
public static string S3BucketAwsRegion => Config.GetAppSetting("S3_BUCKET_AWS_REGION");
public static string S3BucketAwsAccessKeyId => Config.GetAppSetting("AWS_ACCESS_KEY_ID");
public static string S3BucketAwsSecretAccessKey => Config.GetAppSetting("AWS_SECRET_ACCESS_KEY");
public static string S3BucketAwsRegion => Config.GetAppSetting("AWS_DEFAULT_REGION");

public static string CompaniesHouseApiKey => Config.GetAppSetting("CompaniesHouseApiKey");
public static string GovUkNotifyApiKey => Config.GetAppSetting("GovUkNotifyApiKey");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ public bool FileExists(string relativeFilePath)

private AmazonS3Client CreateAmazonS3Client()
{
var credentials = new BasicAWSCredentials(awsAccessKeyId, awsSecretAccessKey);
var amazonS3Client = new AmazonS3Client(credentials, RegionEndpoint.GetBySystemName(awsRegion));
var amazonS3Client = new AmazonS3Client();

return amazonS3Client;
}
Expand Down

0 comments on commit b8dcd1d

Please sign in to comment.