Skip to content

Latest commit

 

History

History
72 lines (56 loc) · 3.27 KB

File metadata and controls

72 lines (56 loc) · 3.27 KB

Ramstack.FileSystem.Amazon

NuGet MIT

Provides an implementation of Ramstack.FileSystem using Amazon S3 storage.

Getting Started

To install the Ramstack.FileSystem.Amazon NuGet package in your project, run the following command:

dotnet add package Ramstack.FileSystem.Amazon

Usage

using Ramstack.FileSystem.Amazon;

AmazonS3FileSystem fs = new AmazonS3FileSystem(
    accessKeyId: "...",
    secretAccessKey: "...",
    region: RegionEndpoint.USEast1,
    bucketName: "my-storage");

// Create S3 bucket if it doesn't exist
await fs.CreateBucketAsync(AccessControl.Private);

await foreach (VirtualFile file in fs.GetFilesAsync("/"))
{
    Console.WriteLine(node.Name);
}

You can also configure the file system to be read-only:

AmazonS3FileSystem fs = new AmazonS3FileSystem(
    accessKeyId: "...",
    secretAccessKey: "...",
    region: RegionEndpoint.USEast1,
    bucketName: "my-storage")
{
    IsReadOnly = true
};

Related Projects

Supported versions

Version
.NET 6, 7, 8, 9, 10

Contributions

Bug reports and contributions are welcome.

License

This package is released as open source under the MIT License. See the LICENSE file for more details.