diff --git a/aws/rust-runtime/aws-config/src/lib.rs b/aws/rust-runtime/aws-config/src/lib.rs index 37409321bf..dd87327037 100644 --- a/aws/rust-runtime/aws-config/src/lib.rs +++ b/aws/rust-runtime/aws-config/src/lib.rs @@ -519,6 +519,16 @@ mod loader { ret } + /// Ignore any environment variables on the host during config resolution + /// + /// This allows for testing in a reproducible environment that ensures any + /// environment variables from the host do not influence environment variable + /// resolution. + pub fn empty_test_environment(mut self) -> Self { + self.env = Some(Env::from_slice(&[])); + self + } + /// Override the access token provider used to build [`SdkConfig`]. /// /// # Examples @@ -782,6 +792,7 @@ mod loader { .region() .await }; + let conf = conf.with_region(region.clone()); let retry_config = if let Some(retry_config) = self.retry_config { retry_config