diff --git a/crates/orchestrator/src/data_storage/aws_s3/config.rs b/crates/orchestrator/src/data_storage/aws_s3/config.rs index 949f98db..7c41f3c6 100644 --- a/crates/orchestrator/src/data_storage/aws_s3/config.rs +++ b/crates/orchestrator/src/data_storage/aws_s3/config.rs @@ -4,9 +4,13 @@ use crate::data_storage::DataStorageConfig; /// Represents AWS S3 config struct with all the necessary variables. pub struct AWSS3Config { + /// AWS ACCESS KEY ID pub s3_key_id: String, + /// AWS ACCESS KEY SECRET pub s3_key_secret: String, + /// S3 Bucket Name pub s3_bucket_name: String, + /// S3 Bucket region pub s3_bucket_region: String, } diff --git a/crates/orchestrator/src/data_storage/aws_s3/mod.rs b/crates/orchestrator/src/data_storage/aws_s3/mod.rs index f99d3d67..02a03324 100644 --- a/crates/orchestrator/src/data_storage/aws_s3/mod.rs +++ b/crates/orchestrator/src/data_storage/aws_s3/mod.rs @@ -42,8 +42,12 @@ impl AWSS3 { } } +/// Implementation of `DataStorage` for `AWSS3` +/// contains the function for getting the data and putting the data +/// by taking the key as an argument. #[async_trait] impl DataStorage for AWSS3 { + /// Function to get the data from S3 bucket by Key. async fn get_data(&self, key: &str) -> Result { let response = self.client.get_object().bucket(self.config.s3_bucket_name.clone()).key(key).send().await?; let data_stream = response.body.collect().await.expect("Failed to convert body into AggregatedBytes."); @@ -51,6 +55,7 @@ impl DataStorage for AWSS3 { Ok(data_bytes) } + /// Function to put the data to S3 bucket by Key. async fn put_data(&self, data: ByteStream, key: &str) -> Result<(), Error> { self.client .put_object()