feat: Add Support for AWS S3 Bucket Storage#296
Merged
fvanderflier merged 14 commits intomainfrom Feb 20, 2026
Merged
Conversation
Collaborator
|
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. |
Dappi.HeadlessCms/Services/StorageServices/AwsS3StorageService.cs
Outdated
Show resolved
Hide resolved
Dappi.HeadlessCms/Services/StorageServices/AwsS3StorageService.cs
Outdated
Show resolved
Hide resolved
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"); |
Collaborator
There was a problem hiding this comment.
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
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed?
AwsS3StorageService, which implementsIMediaUploadServiceand provides theSaveFileAsyncmethod for uploading media to external AWS S3 resources.PackageReferencedependencies.AddS3Storageextension method inServicesExtensions.csto registerAwsS3StorageServicewith the dependency injection container.appsettings.jsonas a template for documentation.Why?
Closes #258
Type of Change
How Did You Test This?
Swagger. A media property was added to the model, and file uploads were tested via theSwaggerinterface.Program.cs,.AddS3Storage(builder.Configuration)was added to theAddDappimethod. With the required environment variables configured inappsettings.json, files were successfully uploaded to the AWS S3 bucket..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
Screenshots / Additional Context