AWS SDK for Rust. Documentation.
IRC: #rusoto on irc.freenode.net.
Rust 1.7.0 or later is required.
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:
[dependencies.rusoto]
features = ["dynamodb", "s3"]
version = "x.y.z"
You can use the Cargo feature "all" to build Rusoto with support for every available service.
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 are included at the end of this document.
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::{ChainProvider, Region}
use rusoto::dynamodb::{DynamoDBClient, ListTablesInput};
fn main() {
let provider = ChainProvider::new().unwrap();
let mut client = DynamoDBClient::new(provider, Region::UsEast1);
let list_tables_input: ListTablesInput = Default::default();
match client.list_tables(&list_tables_input) {
Ok(output) => {
match output.TableNames {
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.
For more information on Rusoto's use of AWS credentials such as priority and refreshing, see AWS Credentials.
Rusoto uses the log logging facade. For tests it uses env_logger. To see output of logging from integration tests, run:
RUST_LOG=info cargo test --features all
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.
Information on release schedules and procedures are in RELEASING.
Service | Cargo feature |
---|---|
All supported services | all |
DynamoDB | dynamodb |
EC2 | ec2 |
ECS | ecs |
Elastic Transcoder | ets |
KMS | kms |
S3 | s3 |
SQS | sqs |
See CONTRIBUTING.