WriteableFileProviders.AmazonS3 2027.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package WriteableFileProviders.AmazonS3 --version 2027.1.0
                    
NuGet\Install-Package WriteableFileProviders.AmazonS3 -Version 2027.1.0
                    
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="WriteableFileProviders.AmazonS3" Version="2027.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WriteableFileProviders.AmazonS3" Version="2027.1.0" />
                    
Directory.Packages.props
<PackageReference Include="WriteableFileProviders.AmazonS3" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WriteableFileProviders.AmazonS3 --version 2027.1.0
                    
#r "nuget: WriteableFileProviders.AmazonS3, 2027.1.0"
                    
#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.
#:package WriteableFileProviders.AmazonS3@2027.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WriteableFileProviders.AmazonS3&version=2027.1.0
                    
Install as a Cake Addin
#tool nuget:?package=WriteableFileProviders.AmazonS3&version=2027.1.0
                    
Install as a Cake Tool

WriteableFileProviders.AmazonS3

An Amazon S3 bucket, or a bucket on an S3-compatible server, as an IWriteableFileProvider, on AWSSDK.S3 4. Part of WriteableFileProviders.

Install

dotnet add package WriteableFileProviders.AmazonS3

Needs .NET 10, and is native AOT compatible. Keep every WriteableFileProviders package in an app on the same major version.

Use

using WriteableFileProviders;
using WriteableFileProviders.AmazonS3;

await using var files = new WriteableAmazonS3FileProvider(new AmazonS3FileProviderOptions
{
    BucketName = "my-bucket",
    BucketRegion = "eu-west-1",
    UseDefaultCredentials = true,
    RootDirectoryPath = "tenants/acme",
});

await files.UpdateFileAsync("reports/2026.csv", stream);
var url = await files.GetSignedUrlAsync("reports/2026.csv", new SignedUrlOptions { Validity = TimeSpan.FromHours(1) });

From configuration (services.AddWriteableFileProvider(section)):

{ "Files": { "Type": "WriteableAmazonS3FileProvider", "BucketName": "my-bucket", "BucketRegion": "eu-west-1",
             "AccessKey": "...", "SecretKey": "..." } }

Or pass an IAmazonS3 you build (assumed roles, retries, a shared client), which the provider never disposes: new WriteableAmazonS3FileProvider(new AmazonS3FileProviderOptions { BucketName = "my-bucket" }, s3). The client's credentials and endpoint are used; the options give the bucket, the root, the storage class and CreateBucketIfMissing.

Configuration

Option Default Meaning
BucketName required The bucket.
BucketRegion The bucket's region, such as eu-west-1. Required unless ServiceUrl is set; then it is the signing region (us-east-1 when empty).
AccessKey, SecretKey A key pair. The secret key is a secret.
UseDefaultCredentials false Use the AWS SDK's default credential chain: environment, profiles, web identity, ECS, EC2. Not with AccessKey.
IsAnonymus false Send unsigned requests, for a public bucket. The spelling is kept for stored configurations.
StorageClassForNewFiles STANDARD The storage class of new files and copies, by name (STANDARD_IA).
ServiceUrl AWS An S3-compatible endpoint instead of AWS, such as http://localhost:9000.
ForcePathStyle false Put the bucket in the path (host/bucket/key), as most S3-compatible servers need.
AllowInsecureHttp false Allow plain http to a host that isn't loopback. Without it, such an endpoint throws ArgumentException.
CreateBucketIfMissing false Create the bucket on first use. Without it, a missing bucket throws InvalidOperationException.
RootDirectoryPath the bucket The folder in the bucket the provider is confined to.

Authentication

The first that applies: UseDefaultCredentials, then IsAnonymus, then AccessKey with SecretKey. None of them, or UseDefaultCredentials with AccessKey, throws ArgumentException when the provider is built. For anything else, pass your own IAmazonS3. Nothing touches the network until the first call.

What's different

  • Writes up to 8 MiB are one PUT, larger ones a multipart upload. A failed write leaves the old content.
  • Conditions (IfMatch, IfNotExists) go to S3 with the write, which checks them atomically. Toward a ServiceUrl, the provider also checks them first: not atomic, since the server may ignore them.
  • Appends rewrite the file with If-Match on the version read: a concurrent write makes the append throw PreconditionFailedException.
  • Copies and moves run on the server, files over 5 GiB in parts of 512 MiB or more. A move deletes the source with If-Match and undoes the copy if the source changed meanwhile.
  • Listings carry no content type; GetFileInfoAsync does. Requester-pays buckets work on AWS.
  • Old versions: ReadFileVersionAsync(versionId, path) reads one in a bucket with versioning.
  • Signed URLs are presigned (SigV4) read and write URLs, up to 7 days. Create URLs are native only on AWS without a ServiceUrl; elsewhere the gateway issues them. A URL never outlives its credential: with temporary credentials, or your own client, set AllowShorterValidity. An anonymous provider can't presign.
  • AWS_ENDPOINT_URL_S3, AWS_ENDPOINT_URL or a profile's endpoint_url redirect the provider like a ServiceUrl does. Set AWS_IGNORE_CONFIGURED_ENDPOINT_URLS to ignore them.
  • Limits: 10,000 parts per file: 5 TiB from a stream with a known length, about 430 GiB without. Watch throws NotSupportedException.

Learn more

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2027.1.1 39 10/13/2026
2027.1.1-rc.1 40 10/13/2026
2027.1.0 61 10/12/2026
2027.1.0-rc.1 50 10/12/2026
2027.0.0 318 10/11/2026
2027.0.0-rc.2 53 10/11/2026
Loading failed