Upload File to S3 Bucket API Using AWS .Net SDK
AWS has become an integral part of many software projects as it offers a wide variety of services that could help any project achieve their goals. The S3 bucket is one of those services. Using the SDK that AWS provides, managing files on your S3 bucket has never been easier and I will show you an example of how to upload a file to an S3 bucket. Let's create this API using traditional clean architecture and not using CQRS or MediatR like my previous post. Just because Command and Query offer a looser coupling but in smaller scale projects with not that much business logic and entity operations it wouldn't make sense to keep creating 2+ classes every time you would want to add a new entity action. So, let's start up with an interface for our AWS services class. Interface First, we add an interface so that the controller can use to call the upload service after providing it with a bucket name, path inside the bucket and of course the file itself but as a MemoryStream . namespa...