Skip to content

Comments

feat: Add Support for AWS S3 Bucket Storage#296

Merged
fvanderflier merged 14 commits intomainfrom
feature/support-s3
Feb 20, 2026
Merged

feat: Add Support for AWS S3 Bucket Storage#296
fvanderflier merged 14 commits intomainfrom
feature/support-s3

Conversation

@ElenaStamenkovskaCC
Copy link
Collaborator

@ElenaStamenkovskaCC ElenaStamenkovskaCC commented Feb 12, 2026

What Changed?

  • Implemented AwsS3StorageService, which implements IMediaUploadService and provides the SaveFileAsync method for uploading media to external AWS S3 resources.
  • Added the required AWS PackageReference dependencies.
  • Introduced the AddS3Storage extension method in ServicesExtensions.cs to register AwsS3StorageService with the dependency injection container.
  • Added a new configuration section to the test environment appsettings.json as a template for documentation.

Why?

  • To enable users to choose whether they want their application to upload and manage media files on AWS S3, providing a scalable, reliable, and external storage solution instead of relying on local storage.

Closes #258

Type of Change

  • ✨ New feature (adds new functionality without breaking existing features)

How Did You Test This?

  • Verified functionality using Swagger. A media property was added to the model, and file uploads were tested via the Swagger interface.
  • In Program.cs, .AddS3Storage(builder.Configuration) was added to the AddDappi method. With the required environment variables configured in appsettings.json, files were successfully uploaded to the AWS S3 bucket.
  • When .AddS3Storage(builder.Configuration) was removed, files reverted to being saved locally, confirming the service registration behaves as expected.

What I tested:

  • [ ]
  • [ ]

How to test it:

Review Checklist

  • My code follows the project's style and conventions
  • I've reviewed my own code for obvious issues
  • I've added comments where the code might be confusing
  • I've updated relevant documentation (if needed)
  • I've tested my changes and they work as expected

Screenshots / Additional Context

@fvanderflier
Copy link
Collaborator

fvanderflier commented Feb 12, 2026

1 thing from the top of my head to check is: CDN config for URL access for the uploads. We will discuss this after I gather some info.

@ElenaStamenkovskaCC ElenaStamenkovskaCC marked this pull request as ready for review February 13, 2026 15:40
@ElenaStamenkovskaCC ElenaStamenkovskaCC changed the title feat: create aws service to create a signed url & upload files to s3 feat: Add Support for AWS S3 Bucket Storage Feb 13, 2026
Comment on lines 95 to 109
public static IServiceCollection AddS3Storage(
this IServiceCollection services,
IConfiguration configuration)
{
var accessKey = configuration["AWS:AccessKey"];
var secretKey = configuration["AWS:SecretKey"];
var region = configuration["AWS:Region"];
var bucketName = configuration["AWS:BucketName"];

if (string.IsNullOrWhiteSpace(accessKey) ||
string.IsNullOrWhiteSpace(secretKey) ||
string.IsNullOrWhiteSpace(region) ||
string.IsNullOrWhiteSpace(bucketName))
{
throw new Exception("Environment variables for AWS are not set");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: If you have the time, we can take a look at using the Options pattern to bind a class and validate it via FluentValidations. Here is a video for that concept: https://www.youtube.com/watch?v=jblRYDMTtvg

@fvanderflier fvanderflier merged commit eb7caea into main Feb 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support S3

2 participants