aws_sdk_elasticloadbalancingv2/operation/set_subnets/_set_subnets_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct SetSubnetsInput {
6 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
7 pub load_balancer_arn: ::std::option::Option<::std::string::String>,
8 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
9 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
10 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
11 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
12 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
13 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones. You must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.</p>
14 pub subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
16 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
17 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
18 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
19 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
20 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
21 pub subnet_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>>,
22 /// <p>The IP address type.</p>
23 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
24 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
25 pub ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
26 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
27 pub enable_prefix_for_ipv6_source_nat: ::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum>,
28}
29impl SetSubnetsInput {
30 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
31 pub fn load_balancer_arn(&self) -> ::std::option::Option<&str> {
32 self.load_balancer_arn.as_deref()
33 }
34 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
35 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
36 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
37 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
38 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
39 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones. You must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.</p>
40 ///
41 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subnets.is_none()`.
42 pub fn subnets(&self) -> &[::std::string::String] {
43 self.subnets.as_deref().unwrap_or_default()
44 }
45 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
46 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
47 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
48 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
49 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
50 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
51 ///
52 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subnet_mappings.is_none()`.
53 pub fn subnet_mappings(&self) -> &[crate::types::SubnetMapping] {
54 self.subnet_mappings.as_deref().unwrap_or_default()
55 }
56 /// <p>The IP address type.</p>
57 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
58 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
59 pub fn ip_address_type(&self) -> ::std::option::Option<&crate::types::IpAddressType> {
60 self.ip_address_type.as_ref()
61 }
62 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
63 pub fn enable_prefix_for_ipv6_source_nat(&self) -> ::std::option::Option<&crate::types::EnablePrefixForIpv6SourceNatEnum> {
64 self.enable_prefix_for_ipv6_source_nat.as_ref()
65 }
66}
67impl SetSubnetsInput {
68 /// Creates a new builder-style object to manufacture [`SetSubnetsInput`](crate::operation::set_subnets::SetSubnetsInput).
69 pub fn builder() -> crate::operation::set_subnets::builders::SetSubnetsInputBuilder {
70 crate::operation::set_subnets::builders::SetSubnetsInputBuilder::default()
71 }
72}
73
74/// A builder for [`SetSubnetsInput`](crate::operation::set_subnets::SetSubnetsInput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct SetSubnetsInputBuilder {
78 pub(crate) load_balancer_arn: ::std::option::Option<::std::string::String>,
79 pub(crate) subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
80 pub(crate) subnet_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>>,
81 pub(crate) ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
82 pub(crate) enable_prefix_for_ipv6_source_nat: ::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum>,
83}
84impl SetSubnetsInputBuilder {
85 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
86 /// This field is required.
87 pub fn load_balancer_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88 self.load_balancer_arn = ::std::option::Option::Some(input.into());
89 self
90 }
91 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
92 pub fn set_load_balancer_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93 self.load_balancer_arn = input;
94 self
95 }
96 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
97 pub fn get_load_balancer_arn(&self) -> &::std::option::Option<::std::string::String> {
98 &self.load_balancer_arn
99 }
100 /// Appends an item to `subnets`.
101 ///
102 /// To override the contents of this collection use [`set_subnets`](Self::set_subnets).
103 ///
104 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
105 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
106 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
107 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
108 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
109 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones. You must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.</p>
110 pub fn subnets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 let mut v = self.subnets.unwrap_or_default();
112 v.push(input.into());
113 self.subnets = ::std::option::Option::Some(v);
114 self
115 }
116 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
117 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
118 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
119 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
120 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
121 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones. You must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.</p>
122 pub fn set_subnets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
123 self.subnets = input;
124 self
125 }
126 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
127 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
128 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
129 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
130 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
131 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones. You must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.</p>
132 pub fn get_subnets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
133 &self.subnets
134 }
135 /// Appends an item to `subnet_mappings`.
136 ///
137 /// To override the contents of this collection use [`set_subnet_mappings`](Self::set_subnet_mappings).
138 ///
139 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
140 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
141 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
142 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
143 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
144 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
145 pub fn subnet_mappings(mut self, input: crate::types::SubnetMapping) -> Self {
146 let mut v = self.subnet_mappings.unwrap_or_default();
147 v.push(input);
148 self.subnet_mappings = ::std::option::Option::Some(v);
149 self
150 }
151 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
152 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
153 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
154 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
155 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
156 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
157 pub fn set_subnet_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>>) -> Self {
158 self.subnet_mappings = input;
159 self
160 }
161 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
162 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
163 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
164 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
165 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
166 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
167 pub fn get_subnet_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>> {
168 &self.subnet_mappings
169 }
170 /// <p>The IP address type.</p>
171 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
172 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
173 pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
174 self.ip_address_type = ::std::option::Option::Some(input);
175 self
176 }
177 /// <p>The IP address type.</p>
178 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
179 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
180 pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
181 self.ip_address_type = input;
182 self
183 }
184 /// <p>The IP address type.</p>
185 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
186 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
187 pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
188 &self.ip_address_type
189 }
190 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
191 pub fn enable_prefix_for_ipv6_source_nat(mut self, input: crate::types::EnablePrefixForIpv6SourceNatEnum) -> Self {
192 self.enable_prefix_for_ipv6_source_nat = ::std::option::Option::Some(input);
193 self
194 }
195 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
196 pub fn set_enable_prefix_for_ipv6_source_nat(mut self, input: ::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum>) -> Self {
197 self.enable_prefix_for_ipv6_source_nat = input;
198 self
199 }
200 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
201 pub fn get_enable_prefix_for_ipv6_source_nat(&self) -> &::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum> {
202 &self.enable_prefix_for_ipv6_source_nat
203 }
204 /// Consumes the builder and constructs a [`SetSubnetsInput`](crate::operation::set_subnets::SetSubnetsInput).
205 pub fn build(self) -> ::std::result::Result<crate::operation::set_subnets::SetSubnetsInput, ::aws_smithy_types::error::operation::BuildError> {
206 ::std::result::Result::Ok(crate::operation::set_subnets::SetSubnetsInput {
207 load_balancer_arn: self.load_balancer_arn,
208 subnets: self.subnets,
209 subnet_mappings: self.subnet_mappings,
210 ip_address_type: self.ip_address_type,
211 enable_prefix_for_ipv6_source_nat: self.enable_prefix_for_ipv6_source_nat,
212 })
213 }
214}