Skip to content

mitsuhiko/rusoto

 
 

Repository files navigation

Rusoto

Linux / OS X travis-badge
Windows appveyor-badge
api-docs-badge crates-io license-badge

Rusoto is an AWS SDK for Rust


You may be looking for:

Requirements

Rust 1.15.0 or later is required.

On Linux, OpenSSL is required.

Installation

Rusoto is available on crates.io. To use Rusoto in your Rust program built with Cargo, add it as a dependency and enable the Cargo features for any AWS service you want to use.

For example, to include only S3 and SQS:

[dependencies]
rusoto = {version = "0.22", features = ["s3", "sqs"]}

You can use the Cargo feature "all" to build Rusoto with support for every available service. Warning: building with "all" can require upwards of 5 GB of memory. Most people do not need all 40+ services so use individual features to enable the services you use.

Usage

Rusoto includes a public module for each AWS service it is compiled for containing Rust types for that service's API. A full list of these services and their Cargo feature names can be found here. All other public types are reexported to the crate root. Consult the rustdoc documentation for full details by running cargo doc or visiting the online documentation for the latest crates.io release.

A simple example of using Rusoto's DynamoDB API to list the names of all tables in a database:

extern crate rusoto;

use std::default::Default;

use rusoto::{DefaultCredentialsProvider, Region};
use rusoto::dynamodb::{DynamoDbClient, ListTablesInput};
use rusoto::default_tls_client;

fn main() {
  let provider = DefaultCredentialsProvider::new().unwrap();
  let client = DynamoDbClient::new(default_tls_client().unwrap(), provider, Region::UsEast1);
  let list_tables_input: ListTablesInput = Default::default();

  match client.list_tables(&list_tables_input) {
    Ok(output) => {
      match output.table_names {
        Some(table_name_list) => {
          println!("Tables in database:");

          for table_name in table_name_list {
            println!("{}", table_name);
          }
        }
        None => println!("No tables in database!"),
      }
    }
    Err(error) => {
      println!("Error: {:?}", error);
    }
  }
}

Rusoto exposes relatively low level types for AWS's APIs. It may be convenient to use higher level types, which can be found in the rusoto_helpers crate.

Credentials

For more information on Rusoto's use of AWS credentials such as priority and refreshing, see AWS Credentials.

Semantic versioning

Rusoto complies with semantic versioning 2.0.0. Until reaching 1.0.0 the API is to be considered unstable. See Cargo.toml or rusoto on crates.io for current version.

Releases

Information on release schedules and procedures are in RELEASING.

Contributing

See CONTRIBUTING.

License

Rusoto is distributed under the terms of the MIT license.

See LICENSE for details.

About

AWS SDK for Rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%