Thanks to visit codestin.com
Credit goes to lib.rs

2 stable releases

1.1.0 Apr 20, 2026
1.0.0 Mar 31, 2026

#2397 in Web programming

Apache-2.0

465KB
6.5K SLoC

aws-sdk-sustainability

The AWS Sustainability service provides programmatic access to estimated carbon emissions data for your Amazon Web Services usage. Use the AWS Sustainability service to retrieve, analyze, and track the carbon footprint of your cloud infrastructure over time.

With the AWS Sustainability service, you can:

  • Retrieve estimated carbon emissions for your Amazon Web Services usage across different time periods
  • Group emissions data by dimensions such as account, region, and service
  • Filter emissions data to focus on specific accounts, regions, or services
  • Access multiple emissions calculation methodologies including Location-based Method (LBM) and Market-based Method (MBM)
  • Aggregate emissions data at various time granularities including monthly, quarterly, and yearly periods

The API supports pagination for efficient data retrieval and provides dimension values to help you understand the available grouping and filtering options for your account.

All emissions values are calculated using methodologies aligned with the Greenhouse Gas (GHG) Protocol and are provided in metric tons of carbon dioxide-equivalent (MTCO2e).

Getting Started

Examples are available for many services and operations, check out the usage examples.

The SDK provides one crate per AWS service. You must add Tokio as a dependency within your Rust project to execute asynchronous code. To add aws-sdk-sustainability to your project, add the following to your Cargo.toml file:

[dependencies]
aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
aws-sdk-sustainability = "1.1.0"
tokio = { version = "1", features = ["full"] }

Then in code, a client can be created with the following:

use aws_sdk_sustainability as sustainability;

#[::tokio::main]
async fn main() -> Result<(), sustainability::Error> {
    let config = aws_config::load_from_env().await;
    let client = aws_sdk_sustainability::Client::new(&config);

    // ... make some calls with the client

    Ok(())
}

See the client documentation for information on what calls can be made, and the inputs and outputs for each of those calls.

Using the SDK

Until the SDK is released, we will be adding information about using the SDK to the Developer Guide. Feel free to suggest additional sections for the guide by opening an issue and describing what you are trying to do.

Getting Help

License

This project is licensed under the Apache-2.0 License.

Dependencies

~12–39MB
~613K SLoC