AmazonWebServices 2.1.2

dotnet add package AmazonWebServices --version 2.1.2
NuGet\Install-Package AmazonWebServices -Version 2.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AmazonWebServices" Version="2.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AmazonWebServices --version 2.1.2
#r "nuget: AmazonWebServices, 2.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AmazonWebServices as a Cake Addin
#addin nuget:?package=AmazonWebServices&version=2.1.2

// Install AmazonWebServices as a Cake Tool
#tool nuget:?package=AmazonWebServices&version=2.1.2

Amazon Web Services

It offers simple yet effective methods for Amazon S3 and Simple Email Service.

GitHub Workflow Status (with event) AmazonWebServices Nuget AmazonWebServices Nuget

Quick Start

The usage of AmazonWebServices is quite simple.

  1. Install AmazonWebServices NuGet package from here.
PM> Install-Package AmazonWebServices
  1. Add services.AddAmazonWebServices();
builder.Services.AddAmazonWebServices();
  1. Add the necessary information to the appsettings.json file.
 "AmazonCredentialOptions": {
    "AccessKey": "",
    "SecretKey": ""
  },

  "AmazonS3Options": {
    "BucketName": "",
    "Region": "eu-central-1"
  },

  "AmazonSESOptions": {
    "ConfigurationSetName": "",
    "SmtpOptions": {
      "Host": "",
      "UserName": "",
      "Password": ""
    }
  }
  1. And start using it. And that's it.

To upload and delete files to Amazon S3. "UploadObjectRequest" only supports these extensions: ".jpeg", ".jpg", ".png", ".pdf", ".svg", ".webp".

[ApiController]
public class AmazonS3Service : ControllerBase
{
    private readonly IAmazonS3Service _amazonS3Service;

    public AmazonS3Service(IAmazonS3Service amazonS3Service)
    {
        _amazonS3Service = amazonS3Service;
    }

    [Consumes("multipart/form-data")]
    [Produces("multipart/form-data", "application/json")]
    [HttpPost("upload-object")]
    public async Task<IActionResult> Upload([FromForm] IFormFile file, [FromQuery] string folderName, [FromQuery] string fileName)
    {
        var uploadedFileName = await _amazonS3Service.UploadAsync(new UploadObjectRequest
        {
            File = file,
            FileName = fileName,
            FolderName = folderName
        });
        return Ok(uploadedFileName);
    }

    [Consumes("application/json")]
    [Produces("application/json", "text/plain")]
    [HttpPost("upload")]
    public async Task<IActionResult> Upload([FromQuery] string filePath, [FromQuery] string folderName, [FromQuery]  string fileName)
    {
        var uploadedFileName = await _amazonS3Service.UploadAsync(new UploadRequest
        {
            FilePath = filePath,
            FileName = fileName,
            FolderName = folderName
        });
       return Ok(uploadedFileName);
    }

    [Consumes("application/json")]
    [Produces("application/json", "text/plain")]
    [HttpPost("delete")]
    public async Task<IActionResult> Delete([FromQuery] string folderName, [FromQuery] string fileName)
    {
        await _amazonS3Service.DeleteAsync(fileName, folderName);
        return Ok();
    }
}

To send emails with Amazon SES.

[ApiController]
public class AmazonSesServiceController : ControllerBase
{
    private readonly IAmazonSesService _amazonSesService;

    public AmazonSesServiceController(IAmazonSesService amazonSesService)
    {
        _amazonSesService = amazonSesService;
    }


    [Consumes("application/json")]
    [Produces("application/json", "text/plain")]
    [HttpPost("/sendEmail")]
    public async Task<IActionResult> SendEmail(SendEmailRequest sendEmailRequest)
    {
        await _amazonSesService.SendEMail(sendEmailRequest);
        return Ok();
    }

    [Consumes("multipart/form-data")]
    [Produces("multipart/form-data", "application/json")]
    [HttpPost("/sendSmtpEmail")]
    public async Task<IActionResult> SendSmtpEmail(SendSmtpEmailRequest sendSmtpEmailRequest)
    {
        await _amazonSesService.SendSmtpEMail(sendSmtpEmailRequest);
        return Ok();
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AmazonWebServices:

Package Downloads
SqlBackupToS3

It backs up the MSSQL database you specify, compresses it into zip and backs it up to aws s3.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.2 438 2/27/2024
2.1.1 207 1/22/2024
2.1.0.1 99 1/22/2024
2.1.0 303 12/16/2023
2.0.0 114 12/15/2023
1.1.1 104 12/7/2023
1.0.4 268 10/26/2023
1.0.3.1 75 10/23/2023
1.0.3 107 9/29/2023
1.0.2 96 9/21/2023
1.0.1 88 9/15/2023
1.0.0 104 9/13/2023