aws_sdk_controltower/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(clippy::deprecated_semver)]
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![forbid(unsafe_code)]
20#![warn(missing_docs)]
21#![cfg_attr(docsrs, feature(doc_cfg))]
22//! Amazon Web Services Control Tower offers application programming interface (API) operations that support programmatic interaction with these types of resources:
23//! - [_Controls_](https://docs.aws.amazon.com/controltower/latest/userguide/controls.html)
24//! - [DisableControl](https://docs.aws.amazon.com/controltower/latest/APIReference/API_DisableControl.html)
25//! - [EnableControl](https://docs.aws.amazon.com/controltower/latest/APIReference/API_EnableControl.html)
26//! - [GetEnabledControl](https://docs.aws.amazon.com/controltower/latest/APIReference/API_GetEnabledControl.html)
27//! - [GetControlOperation](https://docs.aws.amazon.com/controltower/latest/APIReference/API_GetControlOperation.html)
28//! - [ListControlOperations](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListControlOperations.html)
29//! - [ListEnabledControls](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListEnabledControls.html)
30//! - [ResetEnabledControl](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ResetEnabledControl.html)
31//! - [UpdateEnabledControl](https://docs.aws.amazon.com/controltower/latest/APIReference/API_UpdateEnabledControl.html)
32//!
33//! - [_Landing zones_](https://docs.aws.amazon.com/controltower/latest/userguide/lz-api-launch.html)
34//! - [CreateLandingZone](https://docs.aws.amazon.com/controltower/latest/APIReference/API_CreateLandingZone.html)
35//! - [DeleteLandingZone](https://docs.aws.amazon.com/controltower/latest/APIReference/API_DeleteLandingZone.html)
36//! - [GetLandingZone](https://docs.aws.amazon.com/controltower/latest/APIReference/API_GetLandingZone.html)
37//! - [GetLandingZoneOperation](https://docs.aws.amazon.com/controltower/latest/APIReference/API_GetLandingZoneOperation.html)
38//! - [ListLandingZones](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListLandingZones.html)
39//! - [ListLandingZoneOperations](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListLandingZoneOperations.html)
40//! - [ResetLandingZone](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ResetLandingZone.html)
41//! - [UpdateLandingZone](https://docs.aws.amazon.com/controltower/latest/APIReference/API_UpdateLandingZone.html)
42//!
43//! - [_Baselines_](https://docs.aws.amazon.com/controltower/latest/userguide/types-of-baselines.html)
44//! - [DisableBaseline](https://docs.aws.amazon.com/controltower/latest/APIReference/API_DisableBaseline.html)
45//! - [EnableBaseline](https://docs.aws.amazon.com/controltower/latest/APIReference/API_EnableBaseline.html)
46//! - [GetBaseline](https://docs.aws.amazon.com/controltower/latest/APIReference/API_GetBaseline.html)
47//! - [GetBaselineOperation](https://docs.aws.amazon.com/controltower/latest/APIReference/API_GetBaselineOperation.html)
48//! - [GetEnabledBaseline](https://docs.aws.amazon.com/controltower/latest/APIReference/API_GetEnabledBaseline.html)
49//! - [ListBaselines](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListBaselines.html)
50//! - [ListEnabledBaselines](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListEnabledBaselines.html)
51//! - [ResetEnabledBaseline](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ResetEnabledBaseline.html)
52//! - [UpdateEnabledBaseline](https://docs.aws.amazon.com/controltower/latest/APIReference/API_UpdateEnabledBaseline.html)
53//!
54//! - [_Tagging_](https://docs.aws.amazon.com/controltower/latest/controlreference/tagging.html)
55//! - [ListTagsForResource](https://docs.aws.amazon.com/controltower/latest/APIReference/API_ListTagsForResource.html)
56//! - [TagResource](https://docs.aws.amazon.com/controltower/latest/APIReference/API_TagResource.html)
57//! - [UntagResource](https://docs.aws.amazon.com/controltower/latest/APIReference/API_UntagResource.html)
58//!
59//! For more information about these types of resources, see the [_Amazon Web Services Control Tower User Guide_](https://docs.aws.amazon.com/controltower/latest/userguide/what-is-control-tower.html).
60//!
61//! __About control APIs__
62//!
63//! These interfaces allow you to apply the Amazon Web Services library of pre-defined _controls_ to your organizational units, programmatically. In Amazon Web Services Control Tower, the terms "control" and "guardrail" are synonyms.
64//!
65//! To call these APIs, you'll need to know:
66//! - the controlIdentifier for the control--or guardrail--you are targeting.
67//! - the ARN associated with the target organizational unit (OU), which we call the targetIdentifier.
68//! - the ARN associated with a resource that you wish to tag or untag.
69//!
70//! __To get the controlIdentifier for your Amazon Web Services Control Tower control:__
71//!
72//! The controlIdentifier is an ARN that is specified for each control. You can view the controlIdentifier in the console on the __Control details__ page, as well as in the documentation.
73//!
74//! __About identifiers for Amazon Web Services Control Tower__
75//!
76//! The Amazon Web Services Control Tower controlIdentifier is unique in each Amazon Web Services Region for each control. You can find the controlIdentifier for each Region and control in the [Tables of control metadata](https://docs.aws.amazon.com/controltower/latest/controlreference/control-metadata-tables.html) or the [Control availability by Region tables](https://docs.aws.amazon.com/controltower/latest/controlreference/control-region-tables.html) in the _Amazon Web Services Control Tower Controls Reference Guide_.
77//!
78//! A quick-reference list of control identifers for the Amazon Web Services Control Tower legacy _Strongly recommended_ and _Elective_ controls is given in [Resource identifiers for APIs and controls](https://docs.aws.amazon.com/controltower/latest/controlreference/control-identifiers.html.html) in the [_Amazon Web Services Control Tower Controls Reference Guide_](https://docs.aws.amazon.com/controltower/latest/controlreference/control-identifiers.html). Remember that _Mandatory_ controls cannot be added or removed.
79//!
80//! __To get the targetIdentifier:__
81//!
82//! The targetIdentifier is the ARN for an OU.
83//!
84//! In the Amazon Web Services Organizations console, you can find the ARN for the OU on the __Organizational unit details__ page associated with that OU.
85//!
86//! __ About landing zone APIs__
87//!
88//! You can configure and launch an Amazon Web Services Control Tower landing zone with APIs. For an introduction and steps, see [Getting started with Amazon Web Services Control Tower using APIs](https://docs.aws.amazon.com/controltower/latest/userguide/getting-started-apis.html).
89//!
90//! For an overview of landing zone API operations, see [Amazon Web Services Control Tower supports landing zone APIs](https://docs.aws.amazon.com/controltower/latest/userguide/2023-all.html#landing-zone-apis). The individual API operations for landing zones are detailed in this document, the [API reference manual](https://docs.aws.amazon.com/controltower/latest/APIReference/API_Operations.html), in the "Actions" section.
91//!
92//! __About baseline APIs__
93//!
94//! You can apply the AWSControlTowerBaseline baseline to an organizational unit (OU) as a way to register the OU with Amazon Web Services Control Tower, programmatically. For a general overview of this capability, see [Amazon Web Services Control Tower supports APIs for OU registration and configuration with baselines](https://docs.aws.amazon.com/controltower/latest/userguide/2024-all.html#baseline-apis).
95//!
96//! You can call the baseline API operations to view the baselines that Amazon Web Services Control Tower enables for your landing zone, on your behalf, when setting up the landing zone. These baselines are read-only baselines.
97//!
98//! The individual API operations for baselines are detailed in this document, the [API reference manual](https://docs.aws.amazon.com/controltower/latest/APIReference/API_Operations.html), in the "Actions" section. For usage examples, see [Baseline API input and output examples with CLI](https://docs.aws.amazon.com/controltower/latest/userguide/baseline-api-examples.html).
99//!
100//! __ About Amazon Web Services Control Catalog identifiers__
101//! - The EnableControl and DisableControl API operations can be called by specifying either the Amazon Web Services Control Tower identifer or the Amazon Web Services Control Catalog identifier. The API response returns the same type of identifier that you specified when calling the API.
102//! - If you use an Amazon Web Services Control Tower identifier to call the EnableControl API, and then call EnableControl again with an Amazon Web Services Control Catalog identifier, Amazon Web Services Control Tower returns an error message stating that the control is already enabled. Similar behavior applies to the DisableControl API operation.
103//! - Mandatory controls and the landing-zone-level Region deny control have Amazon Web Services Control Tower identifiers only.
104//!
105//! __Details and examples__
106//! - [Control API input and output examples with CLI](https://docs.aws.amazon.com/controltower/latest/controlreference/control-api-examples-short.html)
107//! - [Baseline API input and output examples with CLI](https://docs.aws.amazon.com/controltower/latest/userguide/baseline-api-examples.html)
108//! - [Enable controls with CloudFormation](https://docs.aws.amazon.com/controltower/latest/controlreference/enable-controls.html)
109//! - [Launch a landing zone with CloudFormation](https://docs.aws.amazon.com/controltower/latest/userguide/lz-apis-cfn-setup.html)
110//! - [Control metadata tables (large page)](https://docs.aws.amazon.com/controltower/latest/controlreference/control-metadata-tables.html)
111//! - [Control availability by Region tables (large page)](https://docs.aws.amazon.com/controltower/latest/controlreference/control-region-tables.html)
112//! - [List of identifiers for legacy controls](https://docs.aws.amazon.com/controltower/latest/controlreference/control-identifiers.html)
113//! - [Controls reference guide](https://docs.aws.amazon.com/controltower/latest/controlreference/controls.html)
114//! - [Controls library groupings](https://docs.aws.amazon.com/controltower/latest/controlreference/controls-reference.html)
115//! - [Creating Amazon Web Services Control Tower resources with Amazon Web Services CloudFormation](https://docs.aws.amazon.com/controltower/latest/userguide/creating-resources-with-cloudformation.html)
116//!
117//! To view the open source resource repository on GitHub, see [aws-cloudformation/aws-cloudformation-resource-providers-controltower](https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-controltower)
118//!
119//! __Recording API Requests__
120//!
121//! Amazon Web Services Control Tower supports Amazon Web Services CloudTrail, a service that records Amazon Web Services API calls for your Amazon Web Services account and delivers log files to an Amazon S3 bucket. By using information collected by CloudTrail, you can determine which requests the Amazon Web Services Control Tower service received, who made the request and when, and so on. For more about Amazon Web Services Control Tower and its support for CloudTrail, see [Logging Amazon Web Services Control Tower Actions with Amazon Web Services CloudTrail](https://docs.aws.amazon.com/controltower/latest/userguide/logging-using-cloudtrail.html) in the Amazon Web Services Control Tower User Guide. To learn more about CloudTrail, including how to turn it on and find your log files, see the Amazon Web Services CloudTrail User Guide.
122//!
123//! ## Getting Started
124//!
125//! > Examples are available for many services and operations, check out the
126//! > [usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1).
127//!
128//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
129//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-controltower` to
130//! your project, add the following to your **Cargo.toml** file:
131//!
132//! ```toml
133//! [dependencies]
134//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
135//! aws-sdk-controltower = "1.99.0"
136//! tokio = { version = "1", features = ["full"] }
137//! ```
138//!
139//! Then in code, a client can be created with the following:
140//!
141//! ```rust,no_run
142//! use aws_sdk_controltower as controltower;
143//!
144//! #[::tokio::main]
145//! async fn main() -> Result<(), controltower::Error> {
146//! let config = aws_config::load_from_env().await;
147//! let client = aws_sdk_controltower::Client::new(&config);
148//!
149//! // ... make some calls with the client
150//!
151//! Ok(())
152//! }
153//! ```
154//!
155//! See the [client documentation](https://docs.rs/aws-sdk-controltower/latest/aws_sdk_controltower/client/struct.Client.html)
156//! for information on what calls can be made, and the inputs and outputs for each of those calls.
157//!
158//! ## Using the SDK
159//!
160//! Until the SDK is released, we will be adding information about using the SDK to the
161//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest
162//! additional sections for the guide by opening an issue and describing what you are trying to do.
163//!
164//! ## Getting Help
165//!
166//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
167//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
168//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
169//! * [Usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1)
170//!
171//!
172//! # Crate Organization
173//!
174//! The entry point for most customers will be [`Client`], which exposes one method for each API
175//! offered by AWS Control Tower. The return value of each of these methods is a "fluent builder",
176//! where the different inputs for that API are added by builder-style function call chaining,
177//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in
178//! either a successful output or a [`SdkError`](crate::error::SdkError).
179//!
180//! Some of these API inputs may be structs or enums to provide more complex structured information.
181//! These structs and enums live in [`types`](crate::types). There are some simpler types for
182//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives).
183//!
184//! All types required to configure a client via the [`Config`](crate::Config) struct live
185//! in [`config`](crate::config).
186//!
187//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
188//! is the input, output, and error type for that API, as well as builders to construct each of those.
189//!
190//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
191//! client can return. Any other error type can be converted to this `Error` type via the
192//! [`From`](std::convert::From) trait.
193//!
194//! The other modules within this crate are not required for normal usage.
195
196// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
197pub use error_meta::Error;
198
199#[doc(inline)]
200pub use config::Config;
201
202/// Client for calling AWS Control Tower.
203/// ## Constructing a `Client`
204///
205/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
206/// crate should be used to automatically resolve this config using
207/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
208/// across multiple different AWS SDK clients. This config resolution process can be customized
209/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
210/// the [builder pattern] to customize the default config.
211///
212/// In the simplest case, creating a client looks as follows:
213/// ```rust,no_run
214/// # async fn wrapper() {
215/// let config = aws_config::load_from_env().await;
216/// let client = aws_sdk_controltower::Client::new(&config);
217/// # }
218/// ```
219///
220/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
221/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
222/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
223/// done as follows:
224///
225/// ```rust,no_run
226/// # async fn wrapper() {
227/// let sdk_config = ::aws_config::load_from_env().await;
228/// let config = aws_sdk_controltower::config::Builder::from(&sdk_config)
229/// # /*
230/// .some_service_specific_setting("value")
231/// # */
232/// .build();
233/// # }
234/// ```
235///
236/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
237///
238/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
239/// be done once at application start-up.
240///
241/// [`Config`]: crate::Config
242/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
243/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
244/// [`aws-config` docs]: https://docs.rs/aws-config/*
245/// [`aws-config`]: https://crates.io/crates/aws-config
246/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
247/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
248/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
249/// # Using the `Client`
250///
251/// A client has a function for every operation that can be performed by the service.
252/// For example, the [`CreateLandingZone`](crate::operation::create_landing_zone) operation has
253/// a [`Client::create_landing_zone`], function which returns a builder for that operation.
254/// The fluent builder ultimately has a `send()` function that returns an async future that
255/// returns a result, as illustrated below:
256///
257/// ```rust,ignore
258/// let result = client.create_landing_zone()
259/// .version("example")
260/// .send()
261/// .await;
262/// ```
263///
264/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
265/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
266/// information.
267pub mod client;
268
269/// Configuration for AWS Control Tower.
270pub mod config;
271
272/// Common errors and error handling utilities.
273pub mod error;
274
275mod error_meta;
276
277/// Information about this crate.
278pub mod meta;
279
280/// All operations that this crate can perform.
281pub mod operation;
282
283/// Primitives such as `Blob` or `DateTime` used by other types.
284pub mod primitives;
285
286/// Data structures used by operation inputs/outputs.
287pub mod types;
288
289pub(crate) mod protocol_serde;
290
291mod sdk_feature_tracker;
292
293mod serialization_settings;
294
295mod endpoint_lib;
296
297mod lens;
298
299mod serde_util;
300
301mod json_errors;
302
303#[doc(inline)]
304pub use client::Client;