This repo contains the new AWS SDK for Rust (the SDK) and its public roadmap
Please Note: The SDK is currently released as an alpha and is intended strictly for feedback purposes only. Do not use this SDK for production workloads.
The SDK is code generated from Smithy models that represent each AWS service. The code used to generate the SDK can be found in smithy-rs.
Examples are availble for many services and operations, check out the examples folder.
The SDK provides one crate per AWS service. You must add Tokio as a dependency within your Rust project to execute asynchronous code. We will not push the SDK to crates.io during Alpha; you must use it via a Git dependency.
- Create a new Rust project:
cargo new sdk-example
- Add dependencies to DynamoDB and Tokio to your Cargo.toml file:
[dependencies]
aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.19-alpha", package = "aws-config" }
aws-sdk-dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.19-alpha", package = "aws-sdk-dynamodb" }
tokio = { version = "1", features = ["full"] }
-
Provide your AWS credentials with the default credential provider chain, which currently looks in:
- Environment variables:
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
, andAWS_REGION
- Web Identity Token credentials from the environment or container (including EKS)
- The default credentials files located in
~/.aws/config
and~/.aws/credentials
(location can vary per platform) - EC2 Instance Metadata Service (IAM Roles attached to instance) Note: SSO, and ECS credential sources are not supported yet.
- Environment variables:
-
Make a request using DynamoDB
use aws_sdk_dynamodb::{Client, Error};
#[tokio::main]
async fn main() -> Result<(), Error> {
let shared_config = aws_config::load_from_env().await;
let client = Client::new(&shared_config);
let req = client.list_tables().limit(10);
let resp = req.send().await?;
println!("Current DynamoDB tables: {:?}", resp.table_names);
Ok(())
}
In order to use the SDK, you must already have Rust and Cargo installed. If you don't, these instructions describe how to install Rust and Cargo.
Until the SDK is released, we will be adding information about using the SDK to the Guide. Feel free to suggest additional sections for the guide by opening an issue and describing what you are trying to do.
- GitHub discussions - For ideas, RFCs & general questions
- GitHub issues – For bug reports & feature requests
- Generated Docs (latest version)
- Usage examples
The SDK uses GitHub Issues to track feature requests and issues with the SDK. In addition, we use GitHub Projects to provide users with a high level view of our roadmap and the features we're actively working on.
You can provide feedback or report a bug by submitting a GitHub issue. This is the preferred mechanism to give feedback so that other users can engage in the conversation, +1 issues, etc. Issues you open will be evaluated for our roadmap in the Developer Preview launch.
If you are interested in contributing to the SDK, please take a look at CONTRIBUTING
The SDK currently does not provide support for every AWS service. You can see all the services currently supported on AWS_SERVICES_SUPPORTED
The SDK currently requires a minimum of Rust 1.52.1, and is not guaranteed to build on compiler versions earlier than that. While we are still in alpha, we will be keeping the minimum compiler version two releases behind the latest stable release where possible (so if the latest stable is 1.55, we will be on 1.53). However, we are not making any guarantees around this at present. Increases in minimum required Rust version will be called out in the Release Notes for new releases of the SDK.
- Design docs - Design documentation for the SDK lives in the design folder of smithy-rs.
- Runtime / Handwritten code: The Rust Runtime code that underpins the SDK can be accessed here and here. This code is copied into this repo as part of code generation.
- Code Examples
- API reference documentation (rustdoc)
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.