diff options
Diffstat (limited to 'src/modules/aws.rs')
-rw-r--r-- | src/modules/aws.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/modules/aws.rs b/src/modules/aws.rs index 72a57f72e..637ecc7fc 100644 --- a/src/modules/aws.rs +++ b/src/modules/aws.rs @@ -47,7 +47,7 @@ fn get_aws_region_from_config(context: &Context, aws_profile: Option<&str>) -> O } fn get_aws_profile_and_region(context: &Context) -> (Option<Profile>, Option<Region>) { - let profile_env_vars = vec!["AWSU_PROFILE", "AWS_VAULT", "AWS_PROFILE"]; + let profile_env_vars = vec!["AWSU_PROFILE", "AWS_VAULT", "AWSUME_PROFILE", "AWS_PROFILE"]; let profile = profile_env_vars .iter() .find_map(|env_var| context.get_env(env_var)); @@ -215,6 +215,20 @@ mod tests { } #[test] + fn profile_set_from_awsume() { + let actual = ModuleRenderer::new("aws") + .env("AWSUME_PROFILE", "astronauts-awsume") + .env("AWS_PROFILE", "astronauts-profile") + .collect(); + let expected = Some(format!( + "on {}", + Color::Yellow.bold().paint("☁️ astronauts-awsume ") + )); + + assert_eq!(expected, actual); + } + + #[test] fn profile_and_region_set() { let actual = ModuleRenderer::new("aws") .env("AWS_PROFILE", "astronauts") |