aws-secrets 0.1.1

Retrieve AWS secrets and interact with Secrets Manager and SSM Parameter Store
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::borrow::Cow;
use std::env::var;

/// Returns the current AWS profile name.
pub fn aws_profile<'a>() -> Cow<'a, str> {
    get_env("AWS_PROFILE", "default")
}

/// Retrieve the value of an environment variable.
pub fn get_env<'a>(env_var_name: &'a str, default: &'a str) -> Cow<'a, str> {
    if let Ok(value) = var(env_var_name) {
        Cow::Owned(value)
    } else {
        Cow::Borrowed(default)
    }
}