pub async fn new(
        bucket: String,
        prefix: String,
        role_arn: Option<String>,
    ) -> Result<Self, Error> {
        let mut loader = aws_config::from_env();
        if let Some(role_arn) = role_arn {
            let mut role_provider = AssumeRoleProvider::builder(role_arn).session_name("persist");
            if let Some(region) = region::default_provider().region().await {
                role_provider = role_provider.region(region);
            }
            let default_provider =
                SharedCredentialsProvider::new(credentials::default_provider().await);
            loader = loader.credentials_provider(role_provider.build(default_provider));
        }
        let config = AwsConfig::from_loader(loader).await;
        let client = mz_aws_util::s3::client(&config)
            .map_err(|err| format!("connecting client: {}", err))?;
        Ok(S3BlobConfig {
            client,
            bucket,
            prefix,
        })
    }
/// Returns a new [S3BlobConfig] for use in production.
///
/// Stores objects in the given bucket prepended with the (possibly empty)
/// prefix. S3 credentials and region must be available in the process or
/// environment.
Returns a new [S3BlobConfig] for use in production.
Stores objects in the given bucket prepended with the (possibly empty)
prefix. S3 credentials and region must be available in the process or
environment.
Returns a new [ S3BlobConfig ] for use in production . Stores objects in the given bucket prepended with the ( possibly empty ) prefix . S3 credentials and region must be available in the process or environment .
pub async fn new(
        bucket: String,
        prefix: String,
        role_arn: Option<String>,
    ) -> Result<Self, Error> {
        let mut loader = aws_config::from_env();
        if let Some(role_arn) = role_arn {
            let mut role_provider = AssumeRoleProvider::builder(role_arn).session_name("persist");
            if let Some(region) = region::default_provider().region().await {
                role_provider = role_provider.region(region);
            }
            let default_provider =
                SharedCredentialsProvider::new(credentials::default_provider().await);
            loader = loader.credentials_provider(role_provider.build(default_provider));
        }
        let config = AwsConfig::from_loader(loader).await;
        let client = mz_aws_util::s3::client(&config)
            .map_err(|err| format!("connecting client: {}", err))?;
        Ok(S3BlobConfig {
            client,
            bucket,
            prefix,
        })
    }
pub async fn new ( bucket : String , prefix : String , role_arn : Option < String > , ) -> Result < Self , Error > { let mut loader = aws_config :: from_env ( ) ; if let Some ( role_arn ) = role_arn { let mut role_provider = AssumeRoleProvider :: builder ( role_arn ) . session_name ( " " ) ; if let Some ( region ) = region :: default_provider ( ) . region ( ) . await { role_provider = role_provider . region ( region ) ; } let default_provider = SharedCredentialsProvider :: new ( credentials :: default_provider ( ) . await ) ; loader = loader . credentials_provider ( role_provider . build ( default_provider ) ) ; } let config = AwsConfig :: from_loader ( loader ) . await ; let client = mz_aws_util :: s3 :: client ( & config ) . map_err ( | err | format ! ( " " err ) ) ? ; Ok ( S3BlobConfig { client , bucket , prefix , } ) }
Returns a new [S3BlobConfig] for use in production.
Returns a new [ S3BlobConfig ] for use in production .
bucket
String
prefix
String
role_arn
Option<String>
bucket
String
prefix
String
role_arn
Option<String>