WriteableFileProviders.AmazonS3
2027.1.1
dotnet add package WriteableFileProviders.AmazonS3 --version 2027.1.1
NuGet\Install-Package WriteableFileProviders.AmazonS3 -Version 2027.1.1
<PackageReference Include="WriteableFileProviders.AmazonS3" Version="2027.1.1" />
<PackageVersion Include="WriteableFileProviders.AmazonS3" Version="2027.1.1" />
<PackageReference Include="WriteableFileProviders.AmazonS3" />
paket add WriteableFileProviders.AmazonS3 --version 2027.1.1
#r "nuget: WriteableFileProviders.AmazonS3, 2027.1.1"
#:package WriteableFileProviders.AmazonS3@2027.1.1
#addin nuget:?package=WriteableFileProviders.AmazonS3&version=2027.1.1
#tool nuget:?package=WriteableFileProviders.AmazonS3&version=2027.1.1
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 aServiceUrl, the provider also checks them first: not atomic, since the server may ignore them. - Appends rewrite the file with
If-Matchon the version read. After a concurrent write the append reads the file again and appends after it, up to five attempts in all, then throwsPreconditionFailedException. - 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-Matchand undoes the copy if the source changed meanwhile. - Listings carry no content type;
GetFileInfoAsyncdoes. 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, setAllowShorterValidity. An anonymous provider can't presign. AWS_ENDPOINT_URL_S3,AWS_ENDPOINT_URLor a profile'sendpoint_urlredirect the provider like aServiceUrldoes. SetAWS_IGNORE_CONFIGURED_ENDPOINT_URLSto ignore them.- Limits: 10,000 parts per file: 5 TiB from a stream with a known length, about 430 GiB without.
WatchthrowsNotSupportedException.
Learn more
- The guide: reading and writing, signed URLs, errors, providers compared.
- Moving from 2026.
| Product | Versions 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. |
-
net10.0
- AWSSDK.S3 (>= 4.0.104.2)
- WriteableFileProviders.Common (>= 2027.1.1 && < 2028.0.0-alpha)
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 |
What each release changed: https://github.com/serionist/WriteableFileProviders/blob/main/CHANGELOG.md. Moving from 2026.x: https://github.com/serionist/WriteableFileProviders/blob/main/docs/migration-2027.md