Crate aws_cred

Crate aws_cred 

Source
Expand description

§AWS Credentials Manipulation Library

This library provides a convenient way to load, modify, and save AWS credentials stored in the standard AWS credentials file format. With this library, you can easily manage profiles and their associated credentials without having to manually edit the credentials file.

§Example Usage

fn main() -> Result<(), Box<dyn std::error::Error>> {
    use aws_cred::AWSCredentials;
    let mut credentials = AWSCredentials::load()?;
    credentials
        .with_profile("default")
        .set_access_key_id("ACCESS_KEY")
        .set_secret_access_key("SECRET_KEY");
    credentials.write()?;
    Ok(())
}

Structs§

AWSCredentials
Contains a mapping of profiles to AWS credentials. Provides methods to load from, and save to, the default AWS credentials file.
Credentials
Represents AWS credentials with fields for access and secret keys.
CredentialsBuilder
Builder for Credentials.
CredentialsSetter
A setter which could be used to set key-value pair in a specified section

Enums§

CredentialsBuilderError
Error type for CredentialsBuilder
Error