aws_sdk_networkfirewall/
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//! This is the API Reference for Network Firewall. This guide is for developers who need detailed information about the Network Firewall API actions, data types, and errors.
23//!
24//! The REST API requires you to handle connection details, such as calculating signatures, handling request retries, and error handling. For general information about using the Amazon Web Services REST APIs, see [Amazon Web Services APIs](https://docs.aws.amazon.com/general/latest/gr/aws-apis.html).
25//!
26//! To view the complete list of Amazon Web Services Regions where Network Firewall is available, see [Service endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/network-firewall.html) in the _Amazon Web Services General Reference_.
27//!
28//! To access Network Firewall using the IPv4 REST API endpoint: https://network-firewall..amazonaws.com
29//!
30//! To access Network Firewall using the Dualstack (IPv4 and IPv6) REST API endpoint: https://network-firewall..aws.api
31//!
32//! Alternatively, you can use one of the Amazon Web Services SDKs to access an API that's tailored to the programming language or platform that you're using. For more information, see [Amazon Web Services SDKs](http://aws.amazon.com/tools/#SDKs).
33//!
34//! For descriptions of Network Firewall features, including and step-by-step instructions on how to use them through the Network Firewall console, see the [Network Firewall Developer Guide](https://docs.aws.amazon.com/network-firewall/latest/developerguide/).
35//!
36//! Network Firewall is a stateful, managed, network firewall and intrusion detection and prevention service for Amazon Virtual Private Cloud (Amazon VPC). With Network Firewall, you can filter traffic at the perimeter of your VPC. This includes filtering traffic going to and coming from an internet gateway, NAT gateway, or over VPN or Direct Connect. Network Firewall uses rules that are compatible with Suricata, a free, open source network analysis and threat detection engine. Network Firewall supports Suricata version 7.0.3. For information about Suricata, see the [Suricata website](https://suricata.io/) and the [Suricata User Guide](https://suricata.readthedocs.io/en/suricata-7.0.3/).
37//!
38//! You can use Network Firewall to monitor and protect your VPC traffic in a number of ways. The following are just a few examples:
39//!   - Allow domains or IP addresses for known Amazon Web Services service endpoints, such as Amazon S3, and block all other forms of traffic.
40//!   - Use custom lists of known bad domains to limit the types of domain names that your applications can access.
41//!   - Perform deep packet inspection on traffic entering or leaving your VPC.
42//!   - Use stateful protocol detection to filter protocols like HTTPS, regardless of the port used.
43//!
44//! To enable Network Firewall for your VPCs, you perform steps in both Amazon VPC and in Network Firewall. For information about using Amazon VPC, see [Amazon VPC User Guide](https://docs.aws.amazon.com/vpc/latest/userguide/).
45//!
46//! To start using Network Firewall, do the following:
47//!   1. (Optional) If you don't already have a VPC that you want to protect, create it in Amazon VPC.
48//!   1. In Amazon VPC, in each Availability Zone where you want to have a firewall endpoint, create a subnet for the sole use of Network Firewall.
49//!   1. In Network Firewall, define the firewall behavior as follows:
50//!     1. Create stateless and stateful rule groups, to define the components of the network traffic filtering behavior that you want your firewall to have.
51//!     1. Create a firewall policy that uses your rule groups and specifies additional default traffic filtering behavior.
52//!
53//!   1. In Network Firewall, create a firewall and specify your new firewall policy and VPC subnets. Network Firewall creates a firewall endpoint in each subnet that you specify, with the behavior that's defined in the firewall policy.
54//!   1. In Amazon VPC, use ingress routing enhancements to route traffic through the new firewall endpoints.
55//!
56//! After your firewall is established, you can add firewall endpoints for new Availability Zones by following the prior steps for the Amazon VPC setup and firewall subnet definitions. You can also add endpoints to Availability Zones that you're using in the firewall, either for the same VPC or for another VPC, by following the prior steps for the Amazon VPC setup, and defining the new VPC subnets as VPC endpoint associations.
57//!
58//! ## Getting Started
59//!
60//! > Examples are available for many services and operations, check out the
61//! > [usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1).
62//!
63//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
64//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-networkfirewall` to
65//! your project, add the following to your **Cargo.toml** file:
66//!
67//! ```toml
68//! [dependencies]
69//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
70//! aws-sdk-networkfirewall = "1.95.0"
71//! tokio = { version = "1", features = ["full"] }
72//! ```
73//!
74//! Then in code, a client can be created with the following:
75//!
76//! ```rust,no_run
77//! use aws_sdk_networkfirewall as networkfirewall;
78//!
79//! #[::tokio::main]
80//! async fn main() -> Result<(), networkfirewall::Error> {
81//!     let config = aws_config::load_from_env().await;
82//!     let client = aws_sdk_networkfirewall::Client::new(&config);
83//!
84//!     // ... make some calls with the client
85//!
86//!     Ok(())
87//! }
88//! ```
89//!
90//! See the [client documentation](https://docs.rs/aws-sdk-networkfirewall/latest/aws_sdk_networkfirewall/client/struct.Client.html)
91//! for information on what calls can be made, and the inputs and outputs for each of those calls.
92//!
93//! ## Using the SDK
94//!
95//! Until the SDK is released, we will be adding information about using the SDK to the
96//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest
97//! additional sections for the guide by opening an issue and describing what you are trying to do.
98//!
99//! ## Getting Help
100//!
101//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
102//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
103//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
104//! * [Usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1)
105//!
106//!
107//! # Crate Organization
108//!
109//! The entry point for most customers will be [`Client`], which exposes one method for each API
110//! offered by AWS Network Firewall. The return value of each of these methods is a "fluent builder",
111//! where the different inputs for that API are added by builder-style function call chaining,
112//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in
113//! either a successful output or a [`SdkError`](crate::error::SdkError).
114//!
115//! Some of these API inputs may be structs or enums to provide more complex structured information.
116//! These structs and enums live in [`types`](crate::types). There are some simpler types for
117//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives).
118//!
119//! All types required to configure a client via the [`Config`](crate::Config) struct live
120//! in [`config`](crate::config).
121//!
122//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
123//! is the input, output, and error type for that API, as well as builders to construct each of those.
124//!
125//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
126//! client can return. Any other error type can be converted to this `Error` type via the
127//! [`From`](std::convert::From) trait.
128//!
129//! The other modules within this crate are not required for normal usage.
130
131// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
132pub use error_meta::Error;
133
134#[doc(inline)]
135pub use config::Config;
136
137/// Client for calling AWS Network Firewall.
138/// ## Constructing a `Client`
139///
140/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
141/// crate should be used to automatically resolve this config using
142/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
143/// across multiple different AWS SDK clients. This config resolution process can be customized
144/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
145/// the [builder pattern] to customize the default config.
146///
147/// In the simplest case, creating a client looks as follows:
148/// ```rust,no_run
149/// # async fn wrapper() {
150/// let config = aws_config::load_from_env().await;
151/// let client = aws_sdk_networkfirewall::Client::new(&config);
152/// # }
153/// ```
154///
155/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
156/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
157/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
158/// done as follows:
159///
160/// ```rust,no_run
161/// # async fn wrapper() {
162/// let sdk_config = ::aws_config::load_from_env().await;
163/// let config = aws_sdk_networkfirewall::config::Builder::from(&sdk_config)
164/// # /*
165///     .some_service_specific_setting("value")
166/// # */
167///     .build();
168/// # }
169/// ```
170///
171/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
172///
173/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
174/// be done once at application start-up.
175///
176/// [`Config`]: crate::Config
177/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
178/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
179/// [`aws-config` docs]: https://docs.rs/aws-config/*
180/// [`aws-config`]: https://crates.io/crates/aws-config
181/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
182/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
183/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
184/// # Using the `Client`
185///
186/// A client has a function for every operation that can be performed by the service.
187/// For example, the [`AcceptNetworkFirewallTransitGatewayAttachment`](crate::operation::accept_network_firewall_transit_gateway_attachment) operation has
188/// a [`Client::accept_network_firewall_transit_gateway_attachment`], function which returns a builder for that operation.
189/// The fluent builder ultimately has a `send()` function that returns an async future that
190/// returns a result, as illustrated below:
191///
192/// ```rust,ignore
193/// let result = client.accept_network_firewall_transit_gateway_attachment()
194///     .transit_gateway_attachment_id("example")
195///     .send()
196///     .await;
197/// ```
198///
199/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
200/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
201/// information.
202pub mod client;
203
204/// Configuration for AWS Network Firewall.
205pub mod config;
206
207/// Common errors and error handling utilities.
208pub mod error;
209
210mod error_meta;
211
212/// Information about this crate.
213pub mod meta;
214
215/// All operations that this crate can perform.
216pub mod operation;
217
218/// Primitives such as `Blob` or `DateTime` used by other types.
219pub mod primitives;
220
221/// Data structures used by operation inputs/outputs.
222pub mod types;
223
224pub(crate) mod protocol_serde;
225
226mod sdk_feature_tracker;
227
228mod serialization_settings;
229
230mod endpoint_lib;
231
232mod lens;
233
234mod serde_util;
235
236mod json_errors;
237
238#[doc(inline)]
239pub use client::Client;