aws_sdk_appconfig/
lib.rs

1#![allow(deprecated)]
2#![allow(unknown_lints)]
3#![allow(clippy::module_inception)]
4#![allow(clippy::upper_case_acronyms)]
5#![allow(clippy::large_enum_variant)]
6#![allow(clippy::wrong_self_convention)]
7#![allow(clippy::should_implement_trait)]
8#![allow(clippy::disallowed_names)]
9#![allow(clippy::vec_init_then_push)]
10#![allow(clippy::type_complexity)]
11#![allow(clippy::needless_return)]
12#![allow(clippy::derive_partial_eq_without_eq)]
13#![allow(clippy::result_large_err)]
14#![allow(clippy::unnecessary_map_on_constructor)]
15#![allow(rustdoc::bare_urls)]
16#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::invalid_html_tags)]
18#![forbid(unsafe_code)]
19#![warn(missing_docs)]
20#![cfg_attr(docsrs, feature(doc_auto_cfg))]
21//! AppConfig feature flags and dynamic configurations help software builders quickly and securely adjust application behavior in production environments without full code deployments. AppConfig speeds up software release frequency, improves application resiliency, and helps you address emergent issues more quickly. With feature flags, you can gradually release new capabilities to users and measure the impact of those changes before fully deploying the new capabilities to all users. With operational flags and dynamic configurations, you can update block lists, allow lists, throttling limits, logging verbosity, and perform other operational tuning to quickly respond to issues in production environments.
22//!
23//! Despite the fact that application configuration content can vary greatly from application to application, AppConfig supports the following use cases, which cover a broad spectrum of customer needs:
24//!   - __Feature flags and toggles__ - Safely release new capabilities to your customers in a controlled environment. Instantly roll back changes if you experience a problem.
25//!   - __Application tuning__ - Carefully introduce application changes while testing the impact of those changes with users in production environments.
26//!   - __Allow list or block list__ - Control access to premium features or instantly block specific users without deploying new code.
27//!   - __Centralized configuration storage__ - Keep your configuration data organized and consistent across all of your workloads. You can use AppConfig to deploy configuration data stored in the AppConfig hosted configuration store, Secrets Manager, Systems Manager, Parameter Store, or Amazon S3.
28//!
29//! __How AppConfig works__
30//!
31//! This section provides a high-level description of how AppConfig works and how you get started.
32//!
33//! __1. Identify configuration values in code you want to manage in the cloud__
34//!
35//! Before you start creating AppConfig artifacts, we recommend you identify configuration data in your code that you want to dynamically manage using AppConfig. Good examples include feature flags or toggles, allow and block lists, logging verbosity, service limits, and throttling rules, to name a few. If your configuration data already exists in the cloud, you can take advantage of AppConfig validation, deployment, and extension features to further streamline configuration data management.
36//!
37//! __2. Create an application namespace__
38//!
39//! To create a namespace, you create an AppConfig artifact called an application. An application is simply an organizational construct like a folder.
40//!
41//! __3. Create environments__
42//!
43//! For each AppConfig application, you define one or more environments. An environment is a logical grouping of targets, such as applications in a Beta or Production environment, Lambda functions, or containers. You can also define environments for application subcomponents, such as the Web, Mobile, and Back-end. You can configure Amazon CloudWatch alarms for each environment. The system monitors alarms during a configuration deployment. If an alarm is triggered, the system rolls back the configuration.
44//!
45//! __4. Create a configuration profile__
46//!
47//! A configuration profile includes, among other things, a URI that enables AppConfig to locate your configuration data in its stored location and a profile type. AppConfig supports two configuration profile types: feature flags and freeform configurations. Feature flag configuration profiles store their data in the AppConfig hosted configuration store and the URI is simply hosted. For freeform configuration profiles, you can store your data in the AppConfig hosted configuration store or any Amazon Web Services service that integrates with AppConfig, as described in [Creating a free form configuration profile](http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-free-form-configurations-creating.html) in the the _AppConfig User Guide_. A configuration profile can also include optional validators to ensure your configuration data is syntactically and semantically correct. AppConfig performs a check using the validators when you start a deployment. If any errors are detected, the deployment rolls back to the previous configuration data.
48//!
49//! __5. Deploy configuration data__
50//!
51//! When you create a new deployment, you specify the following:   - An application ID
52//!   - A configuration profile ID
53//!   - A configuration version
54//!   - An environment ID where you want to deploy the configuration data
55//!   - A deployment strategy ID that defines how fast you want the changes to take effect
56//! When you call the [StartDeployment](https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_StartDeployment.html) API action, AppConfig performs the following tasks:   1. Retrieves the configuration data from the underlying data store by using the location URI in the configuration profile.
57//!   1. Verifies the configuration data is syntactically and semantically correct by using the validators you specified when you created your configuration profile.
58//!   1. Caches a copy of the data so it is ready to be retrieved by your application. This cached copy is called the _deployed data_.
59//!
60//!
61//! __6. Retrieve the configuration__
62//!
63//! You can configure AppConfig Agent as a local host and have the agent poll AppConfig for configuration updates. The agent calls the [StartConfigurationSession](https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_StartConfigurationSession.html) and [GetLatestConfiguration](https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html) API actions and caches your configuration data locally. To retrieve the data, your application makes an HTTP call to the localhost server. AppConfig Agent supports several use cases, as described in [Simplified retrieval methods](http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-simplified-methods.html) in the the _AppConfig User Guide_. If AppConfig Agent isn't supported for your use case, you can configure your application to poll AppConfig for configuration updates by directly calling the [StartConfigurationSession](https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_StartConfigurationSession.html) and [GetLatestConfiguration](https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html) API actions.
64//!
65//!
66//! This reference is intended to be used with the [AppConfig User Guide](http://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html).
67//!
68//! ## Getting Started
69//!
70//! > Examples are available for many services and operations, check out the
71//! > [examples folder in GitHub](https://github.com/awslabs/aws-sdk-rust/tree/main/examples).
72//!
73//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
74//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-appconfig` to
75//! your project, add the following to your **Cargo.toml** file:
76//!
77//! ```toml
78//! [dependencies]
79//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
80//! aws-sdk-appconfig = "1.88.0"
81//! tokio = { version = "1", features = ["full"] }
82//! ```
83//!
84//! Then in code, a client can be created with the following:
85//!
86//! ```rust,no_run
87//! use aws_sdk_appconfig as appconfig;
88//!
89//! #[::tokio::main]
90//! async fn main() -> Result<(), appconfig::Error> {
91//!     let config = aws_config::load_from_env().await;
92//!     let client = aws_sdk_appconfig::Client::new(&config);
93//!
94//!     // ... make some calls with the client
95//!
96//!     Ok(())
97//! }
98//! ```
99//!
100//! See the [client documentation](https://docs.rs/aws-sdk-appconfig/latest/aws_sdk_appconfig/client/struct.Client.html)
101//! for information on what calls can be made, and the inputs and outputs for each of those calls.
102//!
103//! ## Using the SDK
104//!
105//! Until the SDK is released, we will be adding information about using the SDK to the
106//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest
107//! additional sections for the guide by opening an issue and describing what you are trying to do.
108//!
109//! ## Getting Help
110//!
111//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
112//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
113//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
114//! * [Usage examples](https://github.com/awslabs/aws-sdk-rust/tree/main/examples)
115//!
116//!
117//! # Crate Organization
118//!
119//! The entry point for most customers will be [`Client`], which exposes one method for each API
120//! offered by Amazon AppConfig. The return value of each of these methods is a "fluent builder",
121//! where the different inputs for that API are added by builder-style function call chaining,
122//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in
123//! either a successful output or a [`SdkError`](crate::error::SdkError).
124//!
125//! Some of these API inputs may be structs or enums to provide more complex structured information.
126//! These structs and enums live in [`types`](crate::types). There are some simpler types for
127//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives).
128//!
129//! All types required to configure a client via the [`Config`](crate::Config) struct live
130//! in [`config`](crate::config).
131//!
132//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
133//! is the input, output, and error type for that API, as well as builders to construct each of those.
134//!
135//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
136//! client can return. Any other error type can be converted to this `Error` type via the
137//! [`From`](std::convert::From) trait.
138//!
139//! The other modules within this crate are not required for normal usage.
140
141// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
142pub use error_meta::Error;
143
144#[doc(inline)]
145pub use config::Config;
146
147/// Client for calling Amazon AppConfig.
148/// ## Constructing a `Client`
149///
150/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
151/// crate should be used to automatically resolve this config using
152/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
153/// across multiple different AWS SDK clients. This config resolution process can be customized
154/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
155/// the [builder pattern] to customize the default config.
156///
157/// In the simplest case, creating a client looks as follows:
158/// ```rust,no_run
159/// # async fn wrapper() {
160/// let config = aws_config::load_from_env().await;
161/// let client = aws_sdk_appconfig::Client::new(&config);
162/// # }
163/// ```
164///
165/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
166/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
167/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
168/// done as follows:
169///
170/// ```rust,no_run
171/// # async fn wrapper() {
172/// let sdk_config = ::aws_config::load_from_env().await;
173/// let config = aws_sdk_appconfig::config::Builder::from(&sdk_config)
174/// # /*
175///     .some_service_specific_setting("value")
176/// # */
177///     .build();
178/// # }
179/// ```
180///
181/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
182///
183/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
184/// be done once at application start-up.
185///
186/// [`Config`]: crate::Config
187/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
188/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
189/// [`aws-config` docs]: https://docs.rs/aws-config/*
190/// [`aws-config`]: https://crates.io/crates/aws-config
191/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
192/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
193/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
194/// # Using the `Client`
195///
196/// A client has a function for every operation that can be performed by the service.
197/// For example, the [`CreateApplication`](crate::operation::create_application) operation has
198/// a [`Client::create_application`], function which returns a builder for that operation.
199/// The fluent builder ultimately has a `send()` function that returns an async future that
200/// returns a result, as illustrated below:
201///
202/// ```rust,ignore
203/// let result = client.create_application()
204///     .name("example")
205///     .send()
206///     .await;
207/// ```
208///
209/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
210/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
211/// information.
212/// # Waiters
213///
214/// This client provides `wait_until` methods behind the [`Waiters`](crate::client::Waiters) trait.
215/// To use them, simply import the trait, and then call one of the `wait_until` methods. This will
216/// return a waiter fluent builder that takes various parameters, which are documented on the builder
217/// type. Once parameters have been provided, the `wait` method can be called to initiate waiting.
218///
219/// For example, if there was a `wait_until_thing` method, it could look like:
220/// ```rust,ignore
221/// let result = client.wait_until_thing()
222///     .thing_id("someId")
223///     .wait(Duration::from_secs(120))
224///     .await;
225/// ```
226pub mod client;
227
228/// Configuration for Amazon AppConfig.
229pub mod config;
230
231/// Common errors and error handling utilities.
232pub mod error;
233
234mod error_meta;
235
236/// Information about this crate.
237pub mod meta;
238
239/// All operations that this crate can perform.
240pub mod operation;
241
242/// Primitives such as `Blob` or `DateTime` used by other types.
243pub mod primitives;
244
245/// Data structures used by operation inputs/outputs.
246pub mod types;
247
248pub(crate) mod protocol_serde;
249
250mod sdk_feature_tracker;
251
252mod serialization_settings;
253
254mod endpoint_lib;
255
256mod lens;
257
258/// Supporting types for waiters.
259///
260/// Note: to use waiters, import the [`Waiters`](crate::client::Waiters) trait, which adds methods prefixed with `wait_until` to the client.
261pub mod waiters;
262
263mod json_errors;
264
265mod serde_util;
266
267#[doc(inline)]
268pub use client::Client;