Simple AWS S3 client library without all of the heft and dependency drag of the official library.
Encounter an issue or have an enhancement request? Please file an issue or start a discussion here!
- Initial release
Refer to the Test.S3
and Test.S3Compatible
projects for full examples.
using S3Lite;
using S3Lite.ApiObjects;
S3Client s3 = new S3Client()
.WithRegion("us-west-1")
.WithAccessKey("AKIAIOSFODNN7EXAMPLE")
.WithSecretKey("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY")
.WithRequestStyle(RequestStyleEnum.VirtualHostedStyle)
.WithSignatureVersion(SignatureVersionEnum.Version4)
.WithLogger(Console.WriteLine);
using S3Lite;
using S3Lite.ApiObjects;
S3Client s3 = new S3Client()
.WithRegion("us-west-1")
.WithAccessKey("AKIAIOSFODNN7EXAMPLE")
.WithSecretKey("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY")
.WithHostname("localhost")
.WithPort(9000)
.WithProtocol(ProtocolEnum.Http)
.WithRequestStyle(RequestStyleEnum.PathStyle)
.WithLogger(Console.WriteLine);
using S3Lite;
using S3Lite.ApiObjects;
// Service APIs
ListAllMyBucketsResult buckets = await s3.Service.ListBucketsAsync();
// Bucket APIs
bool exists = await s3.Bucket.ExistsAsync("bucket1");
await s3.Bucket.Write("bucket2", "us-west-1");
ListBucketResult objects = await s3.Bucket.ListAsync();
await s3.Bucket.DeleteAsync("bucket2");
// Object APIs
await s3.Object.WriteAsync("bucket1", "myobject", Encoding.UTF8.GetBytes("Hello, world!"));
bool exists = await s3.Object.ExistsAsync("bucket1", "myobject");
byte[] data = await s3.Object.ReadAsync("bucket1", "myobject");
await s3.Object.DeleteAsync("bucket1", "myobject");
Refer to CHANGELOG.md for details.