Crate aws_rds_signer

Source
Expand description

§AWS RDS Signer

A Rust library for generating AWS IAM authentication tokens for Amazon RDS database connections. This crate provides a secure and efficient way to generate authentication tokens for RDS IAM database authentication.

§Features

  • Generate IAM authentication tokens for RDS database connections
  • Support for AWS credentials from environment, instance profiles, and explicit configuration
  • Thread-safe and async-ready implementation
  • Zero unsafe code

§Example

use aws_rds_signer::{Signer, SignerBuilder};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let signer = Signer::builder()
        .region("us-east-1")
        .host("my-db.xxxxx.region.rds.amazonaws.com")
        .port(5432u16)
        .user("my_user")
        .build();

    let token = signer.fetch_token().await?;
    println!("Authentication token: {}", token);
    Ok(())
}

Structs§

Signer
A configured signer for generating RDS IAM authentication tokens.
SignerBuilder
Builder for creating a configured Signer.

Enums§

Error
Represents errors that can occur during the RDS signing process.