aws_sdk_ec2/operation/modify_subnet_attribute/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_subnet_attribute::_modify_subnet_attribute_output::ModifySubnetAttributeOutputBuilder;
3
4pub use crate::operation::modify_subnet_attribute::_modify_subnet_attribute_input::ModifySubnetAttributeInputBuilder;
5
6impl crate::operation::modify_subnet_attribute::builders::ModifySubnetAttributeInputBuilder {
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::modify_subnet_attribute::ModifySubnetAttributeOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::modify_subnet_attribute::ModifySubnetAttributeError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.modify_subnet_attribute();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ModifySubnetAttribute`.
24///
25/// <p>Modifies a subnet attribute. You can only modify one attribute at a time.</p>
26/// <p>Use this action to modify subnets on Amazon Web Services Outposts.</p>
27/// <ul>
28/// <li>
29/// <p>To modify a subnet on an Outpost rack, set both <code>MapCustomerOwnedIpOnLaunch</code> and <code>CustomerOwnedIpv4Pool</code>. These two parameters act as a single attribute.</p></li>
30/// <li>
31/// <p>To modify a subnet on an Outpost server, set either <code>EnableLniAtDeviceIndex</code> or <code>DisableLniAtDeviceIndex</code>.</p></li>
32/// </ul>
33/// <p>For more information about Amazon Web Services Outposts, see the following:</p>
34/// <ul>
35/// <li>
36/// <p><a href="https://docs.aws.amazon.com/outposts/latest/userguide/how-servers-work.html">Outpost servers</a></p></li>
37/// <li>
38/// <p><a href="https://docs.aws.amazon.com/outposts/latest/userguide/how-racks-work.html">Outpost racks</a></p></li>
39/// </ul>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct ModifySubnetAttributeFluentBuilder {
42 handle: ::std::sync::Arc<crate::client::Handle>,
43 inner: crate::operation::modify_subnet_attribute::builders::ModifySubnetAttributeInputBuilder,
44 config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47 crate::client::customize::internal::CustomizableSend<
48 crate::operation::modify_subnet_attribute::ModifySubnetAttributeOutput,
49 crate::operation::modify_subnet_attribute::ModifySubnetAttributeError,
50 > for ModifySubnetAttributeFluentBuilder
51{
52 fn send(
53 self,
54 config_override: crate::config::Builder,
55 ) -> crate::client::customize::internal::BoxFuture<
56 crate::client::customize::internal::SendResult<
57 crate::operation::modify_subnet_attribute::ModifySubnetAttributeOutput,
58 crate::operation::modify_subnet_attribute::ModifySubnetAttributeError,
59 >,
60 > {
61 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62 }
63}
64impl ModifySubnetAttributeFluentBuilder {
65 /// Creates a new `ModifySubnetAttributeFluentBuilder`.
66 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67 Self {
68 handle,
69 inner: ::std::default::Default::default(),
70 config_override: ::std::option::Option::None,
71 }
72 }
73 /// Access the ModifySubnetAttribute as a reference.
74 pub fn as_input(&self) -> &crate::operation::modify_subnet_attribute::builders::ModifySubnetAttributeInputBuilder {
75 &self.inner
76 }
77 /// Sends the request and returns the response.
78 ///
79 /// If an error occurs, an `SdkError` will be returned with additional details that
80 /// can be matched against.
81 ///
82 /// By default, any retryable failures will be retried twice. Retry behavior
83 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84 /// set when configuring the client.
85 pub async fn send(
86 self,
87 ) -> ::std::result::Result<
88 crate::operation::modify_subnet_attribute::ModifySubnetAttributeOutput,
89 ::aws_smithy_runtime_api::client::result::SdkError<
90 crate::operation::modify_subnet_attribute::ModifySubnetAttributeError,
91 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92 >,
93 > {
94 let input = self
95 .inner
96 .build()
97 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98 let runtime_plugins = crate::operation::modify_subnet_attribute::ModifySubnetAttribute::operation_runtime_plugins(
99 self.handle.runtime_plugins.clone(),
100 &self.handle.conf,
101 self.config_override,
102 );
103 crate::operation::modify_subnet_attribute::ModifySubnetAttribute::orchestrate(&runtime_plugins, input).await
104 }
105
106 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107 pub fn customize(
108 self,
109 ) -> crate::client::customize::CustomizableOperation<
110 crate::operation::modify_subnet_attribute::ModifySubnetAttributeOutput,
111 crate::operation::modify_subnet_attribute::ModifySubnetAttributeError,
112 Self,
113 > {
114 crate::client::customize::CustomizableOperation::new(self)
115 }
116 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117 self.set_config_override(::std::option::Option::Some(config_override.into()));
118 self
119 }
120
121 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122 self.config_override = config_override;
123 self
124 }
125 /// <p>Specify <code>true</code> to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address. This includes a network interface that's created when launching an instance into the subnet (the instance therefore receives an IPv6 address).</p>
126 /// <p>If you enable the IPv6 addressing feature for your subnet, your network interface or instance only receives an IPv6 address if it's created using version <code>2016-11-15</code> or later of the Amazon EC2 API.</p>
127 pub fn assign_ipv6_address_on_creation(mut self, input: crate::types::AttributeBooleanValue) -> Self {
128 self.inner = self.inner.assign_ipv6_address_on_creation(input);
129 self
130 }
131 /// <p>Specify <code>true</code> to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address. This includes a network interface that's created when launching an instance into the subnet (the instance therefore receives an IPv6 address).</p>
132 /// <p>If you enable the IPv6 addressing feature for your subnet, your network interface or instance only receives an IPv6 address if it's created using version <code>2016-11-15</code> or later of the Amazon EC2 API.</p>
133 pub fn set_assign_ipv6_address_on_creation(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
134 self.inner = self.inner.set_assign_ipv6_address_on_creation(input);
135 self
136 }
137 /// <p>Specify <code>true</code> to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address. This includes a network interface that's created when launching an instance into the subnet (the instance therefore receives an IPv6 address).</p>
138 /// <p>If you enable the IPv6 addressing feature for your subnet, your network interface or instance only receives an IPv6 address if it's created using version <code>2016-11-15</code> or later of the Amazon EC2 API.</p>
139 pub fn get_assign_ipv6_address_on_creation(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
140 self.inner.get_assign_ipv6_address_on_creation()
141 }
142 /// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a public IPv4 address.</p>
143 /// <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href="http://aws.amazon.com/vpc/pricing/">Amazon VPC pricing page</a>.</p>
144 pub fn map_public_ip_on_launch(mut self, input: crate::types::AttributeBooleanValue) -> Self {
145 self.inner = self.inner.map_public_ip_on_launch(input);
146 self
147 }
148 /// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a public IPv4 address.</p>
149 /// <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href="http://aws.amazon.com/vpc/pricing/">Amazon VPC pricing page</a>.</p>
150 pub fn set_map_public_ip_on_launch(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
151 self.inner = self.inner.set_map_public_ip_on_launch(input);
152 self
153 }
154 /// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a public IPv4 address.</p>
155 /// <p>Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the <i>Public IPv4 Address</i> tab on the <a href="http://aws.amazon.com/vpc/pricing/">Amazon VPC pricing page</a>.</p>
156 pub fn get_map_public_ip_on_launch(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
157 self.inner.get_map_public_ip_on_launch()
158 }
159 /// <p>The ID of the subnet.</p>
160 pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.subnet_id(input.into());
162 self
163 }
164 /// <p>The ID of the subnet.</p>
165 pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166 self.inner = self.inner.set_subnet_id(input);
167 self
168 }
169 /// <p>The ID of the subnet.</p>
170 pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_subnet_id()
172 }
173 /// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a customer-owned IPv4 address.</p>
174 /// <p>When this value is <code>true</code>, you must specify the customer-owned IP pool using <code>CustomerOwnedIpv4Pool</code>.</p>
175 pub fn map_customer_owned_ip_on_launch(mut self, input: crate::types::AttributeBooleanValue) -> Self {
176 self.inner = self.inner.map_customer_owned_ip_on_launch(input);
177 self
178 }
179 /// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a customer-owned IPv4 address.</p>
180 /// <p>When this value is <code>true</code>, you must specify the customer-owned IP pool using <code>CustomerOwnedIpv4Pool</code>.</p>
181 pub fn set_map_customer_owned_ip_on_launch(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
182 self.inner = self.inner.set_map_customer_owned_ip_on_launch(input);
183 self
184 }
185 /// <p>Specify <code>true</code> to indicate that network interfaces attached to instances created in the specified subnet should be assigned a customer-owned IPv4 address.</p>
186 /// <p>When this value is <code>true</code>, you must specify the customer-owned IP pool using <code>CustomerOwnedIpv4Pool</code>.</p>
187 pub fn get_map_customer_owned_ip_on_launch(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
188 self.inner.get_map_customer_owned_ip_on_launch()
189 }
190 /// <p>The customer-owned IPv4 address pool associated with the subnet.</p>
191 /// <p>You must set this value when you specify <code>true</code> for <code>MapCustomerOwnedIpOnLaunch</code>.</p>
192 pub fn customer_owned_ipv4_pool(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193 self.inner = self.inner.customer_owned_ipv4_pool(input.into());
194 self
195 }
196 /// <p>The customer-owned IPv4 address pool associated with the subnet.</p>
197 /// <p>You must set this value when you specify <code>true</code> for <code>MapCustomerOwnedIpOnLaunch</code>.</p>
198 pub fn set_customer_owned_ipv4_pool(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199 self.inner = self.inner.set_customer_owned_ipv4_pool(input);
200 self
201 }
202 /// <p>The customer-owned IPv4 address pool associated with the subnet.</p>
203 /// <p>You must set this value when you specify <code>true</code> for <code>MapCustomerOwnedIpOnLaunch</code>.</p>
204 pub fn get_customer_owned_ipv4_pool(&self) -> &::std::option::Option<::std::string::String> {
205 self.inner.get_customer_owned_ipv4_pool()
206 }
207 /// <p>Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p>
208 /// <p>You must first configure a NAT gateway in a public subnet (separate from the subnet containing the IPv6-only workloads). For example, the subnet containing the NAT gateway should have a <code>0.0.0.0/0</code> route pointing to the internet gateway. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-nat64-dns64.html#nat-gateway-nat64-dns64-walkthrough">Configure DNS64 and NAT64</a> in the <i>Amazon VPC User Guide</i>.</p>
209 pub fn enable_dns64(mut self, input: crate::types::AttributeBooleanValue) -> Self {
210 self.inner = self.inner.enable_dns64(input);
211 self
212 }
213 /// <p>Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p>
214 /// <p>You must first configure a NAT gateway in a public subnet (separate from the subnet containing the IPv6-only workloads). For example, the subnet containing the NAT gateway should have a <code>0.0.0.0/0</code> route pointing to the internet gateway. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-nat64-dns64.html#nat-gateway-nat64-dns64-walkthrough">Configure DNS64 and NAT64</a> in the <i>Amazon VPC User Guide</i>.</p>
215 pub fn set_enable_dns64(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
216 self.inner = self.inner.set_enable_dns64(input);
217 self
218 }
219 /// <p>Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p>
220 /// <p>You must first configure a NAT gateway in a public subnet (separate from the subnet containing the IPv6-only workloads). For example, the subnet containing the NAT gateway should have a <code>0.0.0.0/0</code> route pointing to the internet gateway. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-nat64-dns64.html#nat-gateway-nat64-dns64-walkthrough">Configure DNS64 and NAT64</a> in the <i>Amazon VPC User Guide</i>.</p>
221 pub fn get_enable_dns64(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
222 self.inner.get_enable_dns64()
223 }
224 /// <p>The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).</p>
225 pub fn private_dns_hostname_type_on_launch(mut self, input: crate::types::HostnameType) -> Self {
226 self.inner = self.inner.private_dns_hostname_type_on_launch(input);
227 self
228 }
229 /// <p>The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).</p>
230 pub fn set_private_dns_hostname_type_on_launch(mut self, input: ::std::option::Option<crate::types::HostnameType>) -> Self {
231 self.inner = self.inner.set_private_dns_hostname_type_on_launch(input);
232 self
233 }
234 /// <p>The type of hostname to assign to instances in the subnet at launch. For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name).</p>
235 pub fn get_private_dns_hostname_type_on_launch(&self) -> &::std::option::Option<crate::types::HostnameType> {
236 self.inner.get_private_dns_hostname_type_on_launch()
237 }
238 /// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p>
239 pub fn enable_resource_name_dns_a_record_on_launch(mut self, input: crate::types::AttributeBooleanValue) -> Self {
240 self.inner = self.inner.enable_resource_name_dns_a_record_on_launch(input);
241 self
242 }
243 /// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p>
244 pub fn set_enable_resource_name_dns_a_record_on_launch(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
245 self.inner = self.inner.set_enable_resource_name_dns_a_record_on_launch(input);
246 self
247 }
248 /// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p>
249 pub fn get_enable_resource_name_dns_a_record_on_launch(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
250 self.inner.get_enable_resource_name_dns_a_record_on_launch()
251 }
252 /// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p>
253 pub fn enable_resource_name_dns_aaaa_record_on_launch(mut self, input: crate::types::AttributeBooleanValue) -> Self {
254 self.inner = self.inner.enable_resource_name_dns_aaaa_record_on_launch(input);
255 self
256 }
257 /// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p>
258 pub fn set_enable_resource_name_dns_aaaa_record_on_launch(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
259 self.inner = self.inner.set_enable_resource_name_dns_aaaa_record_on_launch(input);
260 self
261 }
262 /// <p>Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p>
263 pub fn get_enable_resource_name_dns_aaaa_record_on_launch(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
264 self.inner.get_enable_resource_name_dns_aaaa_record_on_launch()
265 }
266 /// <p>Indicates the device position for local network interfaces in this subnet. For example, <code>1</code> indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0).</p>
267 pub fn enable_lni_at_device_index(mut self, input: i32) -> Self {
268 self.inner = self.inner.enable_lni_at_device_index(input);
269 self
270 }
271 /// <p>Indicates the device position for local network interfaces in this subnet. For example, <code>1</code> indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0).</p>
272 pub fn set_enable_lni_at_device_index(mut self, input: ::std::option::Option<i32>) -> Self {
273 self.inner = self.inner.set_enable_lni_at_device_index(input);
274 self
275 }
276 /// <p>Indicates the device position for local network interfaces in this subnet. For example, <code>1</code> indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0).</p>
277 pub fn get_enable_lni_at_device_index(&self) -> &::std::option::Option<i32> {
278 self.inner.get_enable_lni_at_device_index()
279 }
280 /// <p>Specify <code>true</code> to indicate that local network interfaces at the current position should be disabled.</p>
281 pub fn disable_lni_at_device_index(mut self, input: crate::types::AttributeBooleanValue) -> Self {
282 self.inner = self.inner.disable_lni_at_device_index(input);
283 self
284 }
285 /// <p>Specify <code>true</code> to indicate that local network interfaces at the current position should be disabled.</p>
286 pub fn set_disable_lni_at_device_index(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
287 self.inner = self.inner.set_disable_lni_at_device_index(input);
288 self
289 }
290 /// <p>Specify <code>true</code> to indicate that local network interfaces at the current position should be disabled.</p>
291 pub fn get_disable_lni_at_device_index(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
292 self.inner.get_disable_lni_at_device_index()
293 }
294}