87 releases (48 stable)

new 1.49.0 Nov 6, 2024
1.44.0 Sep 27, 2024
1.36.0 Jul 22, 2024
1.18.0 Mar 26, 2024
0.3.0 Dec 15, 2021

#2433 in Network programming

Download history 197/week @ 2024-07-17 252/week @ 2024-07-24 498/week @ 2024-07-31 240/week @ 2024-08-07 358/week @ 2024-08-14 386/week @ 2024-08-21 297/week @ 2024-08-28 334/week @ 2024-09-04 408/week @ 2024-09-11 495/week @ 2024-09-18 397/week @ 2024-09-25 280/week @ 2024-10-02 633/week @ 2024-10-09 543/week @ 2024-10-16 428/week @ 2024-10-23 1058/week @ 2024-10-30

2,694 downloads per month
Used in aws-mocks

Apache-2.0

380KB
5.5K SLoC

aws-sdk-appconfigdata

AppConfig Data provides the data plane APIs your application uses to retrieve configuration data. Here's how it works:

Your application retrieves configuration data by first establishing a configuration session using the AppConfig Data StartConfigurationSession API action. Your session's client then makes periodic calls to GetLatestConfiguration to check for and retrieve the latest data available.

When calling StartConfigurationSession, your code sends the following information:

  • Identifiers (ID or name) of an AppConfig application, environment, and configuration profile that the session tracks.
  • (Optional) The minimum amount of time the session's client must wait between calls to GetLatestConfiguration.

In response, AppConfig provides an InitialConfigurationToken to be given to the session's client and used the first time it calls GetLatestConfiguration for that session.

This token should only be used once in your first call to GetLatestConfiguration. You must use the new token in the GetLatestConfiguration response (NextPollConfigurationToken) in each subsequent call to GetLatestConfiguration.

When calling GetLatestConfiguration, your client code sends the most recent ConfigurationToken value it has and receives in response:

  • NextPollConfigurationToken: the ConfigurationToken value to use on the next call to GetLatestConfiguration.
  • NextPollIntervalInSeconds: the duration the client should wait before making its next call to GetLatestConfiguration. This duration may vary over the course of the session, so it should be used instead of the value sent on the StartConfigurationSession call.
  • The configuration: the latest data intended for the session. This may be empty if the client already has the latest version of the configuration.

The InitialConfigurationToken and NextPollConfigurationToken should only be used once. To support long poll use cases, the tokens are valid for up to 24 hours. If a GetLatestConfiguration call uses an expired token, the system returns BadRequestException.

For more information and to view example CLI commands that show how to retrieve a configuration using the AppConfig Data StartConfigurationSession and GetLatestConfiguration API actions, see Retrieving the configuration in the AppConfig User Guide.

Getting Started

Examples are available for many services and operations, check out the examples folder in GitHub.

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-appconfigdata to your project, add the following to your Cargo.toml file:

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

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

use aws_sdk_appconfigdata as appconfigdata;

#[::tokio::main]
async fn main() -> Result<(), appconfigdata::Error> {
    let config = aws_config::load_from_env().await;
    let client = aws_sdk_appconfigdata::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

~8–19MB
~284K SLoC