AWS extensions for object_store crate based on AWS SDK
It provides credentials source and optional HTTP client based on SDK's http client
-
sso- Enables SSO usage in aws-config -
ring- Enables ring crypto backend for AWS HTTP client -
aws-lc- Enables aws-lc crypto backend for AWS HTTP client -
aws-lc-fips- Enables aws-lc FIPS friendly crypto backend for AWS HTTP client
use core::fmt;
use std::sync::Arc;
use object_store_aws::{object_store, init, AmazonS3Builder};
use object_store_aws::object_store::ObjectStore;
use object_store_aws::object_store::multipart::MultipartStore;
async fn create_s3_store() -> impl ObjectStore + MultipartStore + fmt::Debug + Send + Sync + Clone + 'static {
let credentials = Arc::new(init(None).await.expect("to initialize S3 SDK"));
AmazonS3Builder::from_env().with_bucket_name("my-super-bucket")
.with_region(credentials.region_str())
.with_credentials(credentials).build()
.expect("to create S3 store")
}