aws_sdk_networkfirewall/operation/create_firewall/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_firewall::_create_firewall_output::CreateFirewallOutputBuilder;
3
4pub use crate::operation::create_firewall::_create_firewall_input::CreateFirewallInputBuilder;
5
6impl crate::operation::create_firewall::builders::CreateFirewallInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_firewall::CreateFirewallOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_firewall::CreateFirewallError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_firewall();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateFirewall`.
24///
25/// <p>Creates an Network Firewall <code>Firewall</code> and accompanying <code>FirewallStatus</code> for a VPC.</p>
26/// <p>The firewall defines the configuration settings for an Network Firewall firewall. The settings that you can define at creation include the firewall policy, the subnets in your VPC to use for the firewall endpoints, and any tags that are attached to the firewall Amazon Web Services resource.</p>
27/// <p>After you create a firewall, you can provide additional settings, like the logging configuration.</p>
28/// <p>To update the settings for a firewall, you use the operations that apply to the settings themselves, for example <code>UpdateLoggingConfiguration</code>, <code>AssociateSubnets</code>, and <code>UpdateFirewallDeleteProtection</code>.</p>
29/// <p>To manage a firewall's tags, use the standard Amazon Web Services resource tagging operations, <code>ListTagsForResource</code>, <code>TagResource</code>, and <code>UntagResource</code>.</p>
30/// <p>To retrieve information about firewalls, use <code>ListFirewalls</code> and <code>DescribeFirewall</code>.</p>
31/// <p>To generate a report on the last 30 days of traffic monitored by a firewall, use <code>StartAnalysisReport</code>.</p>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct CreateFirewallFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::create_firewall::builders::CreateFirewallInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::create_firewall::CreateFirewallOutput,
41        crate::operation::create_firewall::CreateFirewallError,
42    > for CreateFirewallFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::create_firewall::CreateFirewallOutput,
50            crate::operation::create_firewall::CreateFirewallError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl CreateFirewallFluentBuilder {
57    /// Creates a new `CreateFirewallFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the CreateFirewall as a reference.
66    pub fn as_input(&self) -> &crate::operation::create_firewall::builders::CreateFirewallInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::create_firewall::CreateFirewallOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::create_firewall::CreateFirewallError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::create_firewall::CreateFirewall::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::create_firewall::CreateFirewall::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::create_firewall::CreateFirewallOutput,
103        crate::operation::create_firewall::CreateFirewallError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>The descriptive name of the firewall. You can't change the name of a firewall after you create it.</p>
118    pub fn firewall_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.firewall_name(input.into());
120        self
121    }
122    /// <p>The descriptive name of the firewall. You can't change the name of a firewall after you create it.</p>
123    pub fn set_firewall_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_firewall_name(input);
125        self
126    }
127    /// <p>The descriptive name of the firewall. You can't change the name of a firewall after you create it.</p>
128    pub fn get_firewall_name(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_firewall_name()
130    }
131    /// <p>The Amazon Resource Name (ARN) of the <code>FirewallPolicy</code> that you want to use for the firewall.</p>
132    pub fn firewall_policy_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.firewall_policy_arn(input.into());
134        self
135    }
136    /// <p>The Amazon Resource Name (ARN) of the <code>FirewallPolicy</code> that you want to use for the firewall.</p>
137    pub fn set_firewall_policy_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_firewall_policy_arn(input);
139        self
140    }
141    /// <p>The Amazon Resource Name (ARN) of the <code>FirewallPolicy</code> that you want to use for the firewall.</p>
142    pub fn get_firewall_policy_arn(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_firewall_policy_arn()
144    }
145    /// <p>The unique identifier of the VPC where Network Firewall should create the firewall.</p>
146    /// <p>You can't change this setting after you create the firewall.</p>
147    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.vpc_id(input.into());
149        self
150    }
151    /// <p>The unique identifier of the VPC where Network Firewall should create the firewall.</p>
152    /// <p>You can't change this setting after you create the firewall.</p>
153    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_vpc_id(input);
155        self
156    }
157    /// <p>The unique identifier of the VPC where Network Firewall should create the firewall.</p>
158    /// <p>You can't change this setting after you create the firewall.</p>
159    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_vpc_id()
161    }
162    ///
163    /// Appends an item to `SubnetMappings`.
164    ///
165    /// To override the contents of this collection use [`set_subnet_mappings`](Self::set_subnet_mappings).
166    ///
167    /// <p>The public subnets to use for your Network Firewall firewalls. Each subnet must belong to a different Availability Zone in the VPC. Network Firewall creates a firewall endpoint in each subnet.</p>
168    pub fn subnet_mappings(mut self, input: crate::types::SubnetMapping) -> Self {
169        self.inner = self.inner.subnet_mappings(input);
170        self
171    }
172    /// <p>The public subnets to use for your Network Firewall firewalls. Each subnet must belong to a different Availability Zone in the VPC. Network Firewall creates a firewall endpoint in each subnet.</p>
173    pub fn set_subnet_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>>) -> Self {
174        self.inner = self.inner.set_subnet_mappings(input);
175        self
176    }
177    /// <p>The public subnets to use for your Network Firewall firewalls. Each subnet must belong to a different Availability Zone in the VPC. Network Firewall creates a firewall endpoint in each subnet.</p>
178    pub fn get_subnet_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>> {
179        self.inner.get_subnet_mappings()
180    }
181    /// <p>A flag indicating whether it is possible to delete the firewall. A setting of <code>TRUE</code> indicates that the firewall is protected against deletion. Use this setting to protect against accidentally deleting a firewall that is in use. When you create a firewall, the operation initializes this flag to <code>TRUE</code>.</p>
182    pub fn delete_protection(mut self, input: bool) -> Self {
183        self.inner = self.inner.delete_protection(input);
184        self
185    }
186    /// <p>A flag indicating whether it is possible to delete the firewall. A setting of <code>TRUE</code> indicates that the firewall is protected against deletion. Use this setting to protect against accidentally deleting a firewall that is in use. When you create a firewall, the operation initializes this flag to <code>TRUE</code>.</p>
187    pub fn set_delete_protection(mut self, input: ::std::option::Option<bool>) -> Self {
188        self.inner = self.inner.set_delete_protection(input);
189        self
190    }
191    /// <p>A flag indicating whether it is possible to delete the firewall. A setting of <code>TRUE</code> indicates that the firewall is protected against deletion. Use this setting to protect against accidentally deleting a firewall that is in use. When you create a firewall, the operation initializes this flag to <code>TRUE</code>.</p>
192    pub fn get_delete_protection(&self) -> &::std::option::Option<bool> {
193        self.inner.get_delete_protection()
194    }
195    /// <p>A setting indicating whether the firewall is protected against changes to the subnet associations. Use this setting to protect against accidentally modifying the subnet associations for a firewall that is in use. When you create a firewall, the operation initializes this setting to <code>TRUE</code>.</p>
196    pub fn subnet_change_protection(mut self, input: bool) -> Self {
197        self.inner = self.inner.subnet_change_protection(input);
198        self
199    }
200    /// <p>A setting indicating whether the firewall is protected against changes to the subnet associations. Use this setting to protect against accidentally modifying the subnet associations for a firewall that is in use. When you create a firewall, the operation initializes this setting to <code>TRUE</code>.</p>
201    pub fn set_subnet_change_protection(mut self, input: ::std::option::Option<bool>) -> Self {
202        self.inner = self.inner.set_subnet_change_protection(input);
203        self
204    }
205    /// <p>A setting indicating whether the firewall is protected against changes to the subnet associations. Use this setting to protect against accidentally modifying the subnet associations for a firewall that is in use. When you create a firewall, the operation initializes this setting to <code>TRUE</code>.</p>
206    pub fn get_subnet_change_protection(&self) -> &::std::option::Option<bool> {
207        self.inner.get_subnet_change_protection()
208    }
209    /// <p>A setting indicating whether the firewall is protected against a change to the firewall policy association. Use this setting to protect against accidentally modifying the firewall policy for a firewall that is in use. When you create a firewall, the operation initializes this setting to <code>TRUE</code>.</p>
210    pub fn firewall_policy_change_protection(mut self, input: bool) -> Self {
211        self.inner = self.inner.firewall_policy_change_protection(input);
212        self
213    }
214    /// <p>A setting indicating whether the firewall is protected against a change to the firewall policy association. Use this setting to protect against accidentally modifying the firewall policy for a firewall that is in use. When you create a firewall, the operation initializes this setting to <code>TRUE</code>.</p>
215    pub fn set_firewall_policy_change_protection(mut self, input: ::std::option::Option<bool>) -> Self {
216        self.inner = self.inner.set_firewall_policy_change_protection(input);
217        self
218    }
219    /// <p>A setting indicating whether the firewall is protected against a change to the firewall policy association. Use this setting to protect against accidentally modifying the firewall policy for a firewall that is in use. When you create a firewall, the operation initializes this setting to <code>TRUE</code>.</p>
220    pub fn get_firewall_policy_change_protection(&self) -> &::std::option::Option<bool> {
221        self.inner.get_firewall_policy_change_protection()
222    }
223    /// <p>A description of the firewall.</p>
224    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225        self.inner = self.inner.description(input.into());
226        self
227    }
228    /// <p>A description of the firewall.</p>
229    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
230        self.inner = self.inner.set_description(input);
231        self
232    }
233    /// <p>A description of the firewall.</p>
234    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
235        self.inner.get_description()
236    }
237    ///
238    /// Appends an item to `Tags`.
239    ///
240    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
241    ///
242    /// <p>The key:value pairs to associate with the resource.</p>
243    pub fn tags(mut self, input: crate::types::Tag) -> Self {
244        self.inner = self.inner.tags(input);
245        self
246    }
247    /// <p>The key:value pairs to associate with the resource.</p>
248    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
249        self.inner = self.inner.set_tags(input);
250        self
251    }
252    /// <p>The key:value pairs to associate with the resource.</p>
253    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
254        self.inner.get_tags()
255    }
256    /// <p>A complex type that contains settings for encryption of your firewall resources.</p>
257    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
258        self.inner = self.inner.encryption_configuration(input);
259        self
260    }
261    /// <p>A complex type that contains settings for encryption of your firewall resources.</p>
262    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
263        self.inner = self.inner.set_encryption_configuration(input);
264        self
265    }
266    /// <p>A complex type that contains settings for encryption of your firewall resources.</p>
267    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
268        self.inner.get_encryption_configuration()
269    }
270    ///
271    /// Appends an item to `EnabledAnalysisTypes`.
272    ///
273    /// To override the contents of this collection use [`set_enabled_analysis_types`](Self::set_enabled_analysis_types).
274    ///
275    /// <p>An optional setting indicating the specific traffic analysis types to enable on the firewall.</p>
276    pub fn enabled_analysis_types(mut self, input: crate::types::EnabledAnalysisType) -> Self {
277        self.inner = self.inner.enabled_analysis_types(input);
278        self
279    }
280    /// <p>An optional setting indicating the specific traffic analysis types to enable on the firewall.</p>
281    pub fn set_enabled_analysis_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnabledAnalysisType>>) -> Self {
282        self.inner = self.inner.set_enabled_analysis_types(input);
283        self
284    }
285    /// <p>An optional setting indicating the specific traffic analysis types to enable on the firewall.</p>
286    pub fn get_enabled_analysis_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnabledAnalysisType>> {
287        self.inner.get_enabled_analysis_types()
288    }
289    /// <p>Required when creating a transit gateway-attached firewall. The unique identifier of the transit gateway to attach to this firewall. You can provide either a transit gateway from your account or one that has been shared with you through Resource Access Manager.</p><important>
290    /// <p>After creating the firewall, you cannot change the transit gateway association. To use a different transit gateway, you must create a new firewall.</p>
291    /// </important>
292    /// <p>For information about creating firewalls, see <code>CreateFirewall</code>. For specific guidance about transit gateway-attached firewalls, see <a href="https://docs.aws.amazon.com/network-firewall/latest/developerguide/tgw-firewall-considerations.html">Considerations for transit gateway-attached firewalls</a> in the <i>Network Firewall Developer Guide</i>.</p>
293    pub fn transit_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
294        self.inner = self.inner.transit_gateway_id(input.into());
295        self
296    }
297    /// <p>Required when creating a transit gateway-attached firewall. The unique identifier of the transit gateway to attach to this firewall. You can provide either a transit gateway from your account or one that has been shared with you through Resource Access Manager.</p><important>
298    /// <p>After creating the firewall, you cannot change the transit gateway association. To use a different transit gateway, you must create a new firewall.</p>
299    /// </important>
300    /// <p>For information about creating firewalls, see <code>CreateFirewall</code>. For specific guidance about transit gateway-attached firewalls, see <a href="https://docs.aws.amazon.com/network-firewall/latest/developerguide/tgw-firewall-considerations.html">Considerations for transit gateway-attached firewalls</a> in the <i>Network Firewall Developer Guide</i>.</p>
301    pub fn set_transit_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
302        self.inner = self.inner.set_transit_gateway_id(input);
303        self
304    }
305    /// <p>Required when creating a transit gateway-attached firewall. The unique identifier of the transit gateway to attach to this firewall. You can provide either a transit gateway from your account or one that has been shared with you through Resource Access Manager.</p><important>
306    /// <p>After creating the firewall, you cannot change the transit gateway association. To use a different transit gateway, you must create a new firewall.</p>
307    /// </important>
308    /// <p>For information about creating firewalls, see <code>CreateFirewall</code>. For specific guidance about transit gateway-attached firewalls, see <a href="https://docs.aws.amazon.com/network-firewall/latest/developerguide/tgw-firewall-considerations.html">Considerations for transit gateway-attached firewalls</a> in the <i>Network Firewall Developer Guide</i>.</p>
309    pub fn get_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
310        self.inner.get_transit_gateway_id()
311    }
312    ///
313    /// Appends an item to `AvailabilityZoneMappings`.
314    ///
315    /// To override the contents of this collection use [`set_availability_zone_mappings`](Self::set_availability_zone_mappings).
316    ///
317    /// <p>Required. The Availability Zones where you want to create firewall endpoints for a transit gateway-attached firewall. You must specify at least one Availability Zone. Consider enabling the firewall in every Availability Zone where you have workloads to maintain Availability Zone isolation.</p>
318    /// <p>You can modify Availability Zones later using <code>AssociateAvailabilityZones</code> or <code>DisassociateAvailabilityZones</code>, but this may briefly disrupt traffic. The <code>AvailabilityZoneChangeProtection</code> setting controls whether you can make these modifications.</p>
319    pub fn availability_zone_mappings(mut self, input: crate::types::AvailabilityZoneMapping) -> Self {
320        self.inner = self.inner.availability_zone_mappings(input);
321        self
322    }
323    /// <p>Required. The Availability Zones where you want to create firewall endpoints for a transit gateway-attached firewall. You must specify at least one Availability Zone. Consider enabling the firewall in every Availability Zone where you have workloads to maintain Availability Zone isolation.</p>
324    /// <p>You can modify Availability Zones later using <code>AssociateAvailabilityZones</code> or <code>DisassociateAvailabilityZones</code>, but this may briefly disrupt traffic. The <code>AvailabilityZoneChangeProtection</code> setting controls whether you can make these modifications.</p>
325    pub fn set_availability_zone_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AvailabilityZoneMapping>>) -> Self {
326        self.inner = self.inner.set_availability_zone_mappings(input);
327        self
328    }
329    /// <p>Required. The Availability Zones where you want to create firewall endpoints for a transit gateway-attached firewall. You must specify at least one Availability Zone. Consider enabling the firewall in every Availability Zone where you have workloads to maintain Availability Zone isolation.</p>
330    /// <p>You can modify Availability Zones later using <code>AssociateAvailabilityZones</code> or <code>DisassociateAvailabilityZones</code>, but this may briefly disrupt traffic. The <code>AvailabilityZoneChangeProtection</code> setting controls whether you can make these modifications.</p>
331    pub fn get_availability_zone_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AvailabilityZoneMapping>> {
332        self.inner.get_availability_zone_mappings()
333    }
334    /// <p>Optional. A setting indicating whether the firewall is protected against changes to its Availability Zone configuration. When set to <code>TRUE</code>, you cannot add or remove Availability Zones without first disabling this protection using <code>UpdateAvailabilityZoneChangeProtection</code>.</p>
335    /// <p>Default value: <code>FALSE</code></p>
336    pub fn availability_zone_change_protection(mut self, input: bool) -> Self {
337        self.inner = self.inner.availability_zone_change_protection(input);
338        self
339    }
340    /// <p>Optional. A setting indicating whether the firewall is protected against changes to its Availability Zone configuration. When set to <code>TRUE</code>, you cannot add or remove Availability Zones without first disabling this protection using <code>UpdateAvailabilityZoneChangeProtection</code>.</p>
341    /// <p>Default value: <code>FALSE</code></p>
342    pub fn set_availability_zone_change_protection(mut self, input: ::std::option::Option<bool>) -> Self {
343        self.inner = self.inner.set_availability_zone_change_protection(input);
344        self
345    }
346    /// <p>Optional. A setting indicating whether the firewall is protected against changes to its Availability Zone configuration. When set to <code>TRUE</code>, you cannot add or remove Availability Zones without first disabling this protection using <code>UpdateAvailabilityZoneChangeProtection</code>.</p>
347    /// <p>Default value: <code>FALSE</code></p>
348    pub fn get_availability_zone_change_protection(&self) -> &::std::option::Option<bool> {
349        self.inner.get_availability_zone_change_protection()
350    }
351}