pub async fn load(&self) -> Result<mz_aws_util::config::AwsConfig, anyhow::Error> {
        use aws_smithy_http::endpoint::Endpoint;
        use aws_types::credentials::SharedCredentialsProvider;
        use aws_types::region::Region;

        let mut loader = aws_config::from_env().region(Region::new(self.region.clone()));
        if let Some(credentials) = &self.credentials {
            loader = loader.credentials_provider(SharedCredentialsProvider::new(
                aws_types::Credentials::from_keys(
                    &credentials.access_key_id,
                    &credentials.secret_access_key,
                    credentials.session_token.clone(),
                ),
            ));
        }
        let mut config = mz_aws_util::config::AwsConfig::from_loader(loader).await;
        if let Some(endpoint) = &self.endpoint {
            let endpoint: Uri = endpoint.parse().context("parsing AWS endpoint")?;
            config.set_endpoint(Endpoint::immutable(endpoint));
        }
        Ok(config)
    }
/// Loads the AWS SDK configuration object from the environment, then
/// applies the overrides from this object.
Loads the AWS SDK configuration object from the environment, then
applies the overrides from this object.
Loads the AWS SDK configuration object from the environment then applies the overrides from this object .
pub async fn load(&self) -> Result<mz_aws_util::config::AwsConfig, anyhow::Error> {
        use aws_smithy_http::endpoint::Endpoint;
        use aws_types::credentials::SharedCredentialsProvider;
        use aws_types::region::Region;
        let mut loader = aws_config::from_env().region(Region::new(self.region.clone()));
        if let Some(credentials) = &self.credentials {
            loader = loader.credentials_provider(SharedCredentialsProvider::new(
                aws_types::Credentials::from_keys(
                    &credentials.access_key_id,
                    &credentials.secret_access_key,
                    credentials.session_token.clone(),
                ),
            ));
        }
        let mut config = mz_aws_util::config::AwsConfig::from_loader(loader).await;
        if let Some(endpoint) = &self.endpoint {
            let endpoint: Uri = endpoint.parse().context("parsing AWS endpoint")?;
            config.set_endpoint(Endpoint::immutable(endpoint));
        }
        Ok(config)
    }
pub async fn load ( & self ) -> Result < mz_aws_util :: config :: AwsConfig , anyhow :: Error > { use aws_smithy_http :: endpoint :: Endpoint ; use aws_types :: credentials :: SharedCredentialsProvider ; use aws_types :: region :: Region ; let mut loader = aws_config :: from_env ( ) . region ( Region :: new ( self . region . clone ( ) ) ) ; if let Some ( credentials ) = & self . credentials { loader = loader . credentials_provider ( SharedCredentialsProvider :: new ( aws_types :: Credentials :: from_keys ( & credentials . access_key_id , & credentials . secret_access_key , credentials . session_token . clone ( ) , ) , ) ) ; } let mut config = mz_aws_util :: config :: AwsConfig :: from_loader ( loader ) . await ; if let Some ( endpoint ) = & self . endpoint { let endpoint : Uri = endpoint . parse ( ) . context ( " " ) ? ; config . set_endpoint ( Endpoint :: immutable ( endpoint ) ) ; } Ok ( config ) }
Loads the AWS SDK configuration object from the environment, then
applies the overrides from this object.
Loads the AWS SDK configuration object from the environment then applies the overrides from this object .
&self
&self