aws_sdk_ec2/waiters/subnet_available.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `subnet_available` waiter.
5///
6/// This builder is intended to be used similar to the other fluent builders for
7/// normal operations on the client. However, instead of a `send` method, it has
8/// a `wait` method that takes a maximum amount of time to wait.
9///
10/// Construct this fluent builder using the client by importing the
11/// [`Waiters`](crate::client::Waiters) trait and calling the methods
12/// prefixed with `wait_until`.
13///
14#[derive(::std::clone::Clone, ::std::fmt::Debug)]
15pub struct SubnetAvailableFluentBuilder {
16 handle: ::std::sync::Arc<crate::client::Handle>,
17 inner: crate::operation::describe_subnets::builders::DescribeSubnetsInputBuilder,
18}
19impl SubnetAvailableFluentBuilder {
20 /// Creates a new `SubnetAvailableFluentBuilder`.
21 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
22 Self {
23 handle,
24 inner: ::std::default::Default::default(),
25 }
26 }
27 /// Access the DescribeSubnets as a reference.
28 pub fn as_input(&self) -> &crate::operation::describe_subnets::builders::DescribeSubnetsInputBuilder {
29 &self.inner
30 }
31 /// Wait for `subnet_available`
32 pub async fn wait(
33 self,
34 max_wait: ::std::time::Duration,
35 ) -> ::std::result::Result<
36 crate::waiters::subnet_available::SubnetAvailableFinalPoll,
37 crate::waiters::subnet_available::WaitUntilSubnetAvailableError,
38 > {
39 let input = self
40 .inner
41 .build()
42 .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
43 let runtime_plugins = crate::operation::describe_subnets::DescribeSubnets::operation_runtime_plugins(
44 self.handle.runtime_plugins.clone(),
45 &self.handle.conf,
46 ::std::option::Option::None,
47 )
48 .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
49 let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
50 let runtime_components_builder = runtime_plugins
51 .apply_client_configuration(&mut cfg)
52 .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
53 let time_components = runtime_components_builder.into_time_components();
54 let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
55 let time_source = time_components.time_source().expect("a time source is required by waiters");
56
57 let acceptor = move |result: ::std::result::Result<
58 &crate::operation::describe_subnets::DescribeSubnetsOutput,
59 &crate::operation::describe_subnets::DescribeSubnetsError,
60 >| {
61 // Matches: {"output":{"path":"Subnets[].State","expected":"available","comparator":"allStringEquals"}}
62 if crate::waiters::matchers::match_describe_subnets_4dd8b1ce0c2205901(result) {
63 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64 }
65 ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
66 };
67 let operation = move || {
68 let input = input.clone();
69 let runtime_plugins = runtime_plugins.clone();
70 async move { crate::operation::describe_subnets::DescribeSubnets::orchestrate(&runtime_plugins, input).await }
71 };
72 let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
73 .min_delay(::std::time::Duration::from_secs(15))
74 .max_delay(::std::time::Duration::from_secs(120))
75 .max_wait(max_wait)
76 .time_source(time_source)
77 .sleep_impl(sleep_impl)
78 .acceptor(acceptor)
79 .operation(operation)
80 .build();
81 ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
82 }
83 ///
84 /// Appends an item to `Filters`.
85 ///
86 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
87 ///
88 /// <p>The filters.</p>
89 /// <ul>
90 /// <li>
91 /// <p><code>availability-zone</code> - The Availability Zone for the subnet. You can also use <code>availabilityZone</code> as the filter name.</p></li>
92 /// <li>
93 /// <p><code>availability-zone-id</code> - The ID of the Availability Zone for the subnet. You can also use <code>availabilityZoneId</code> as the filter name.</p></li>
94 /// <li>
95 /// <p><code>available-ip-address-count</code> - The number of IPv4 addresses in the subnet that are available.</p></li>
96 /// <li>
97 /// <p><code>cidr-block</code> - The IPv4 CIDR block of the subnet. The CIDR block you specify must exactly match the subnet's CIDR block for information to be returned for the subnet. You can also use <code>cidr</code> or <code>cidrBlock</code> as the filter names.</p></li>
98 /// <li>
99 /// <p><code>customer-owned-ipv4-pool</code> - The customer-owned IPv4 address pool associated with the subnet.</p></li>
100 /// <li>
101 /// <p><code>default-for-az</code> - Indicates whether this is the default subnet for the Availability Zone (<code>true</code> | <code>false</code>). You can also use <code>defaultForAz</code> as the filter name.</p></li>
102 /// <li>
103 /// <p><code>enable-dns64</code> - Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p></li>
104 /// <li>
105 /// <p><code>enable-lni-at-device-index</code> - 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).</p></li>
106 /// <li>
107 /// <p><code>ipv6-cidr-block-association.ipv6-cidr-block</code> - An IPv6 CIDR block associated with the subnet.</p></li>
108 /// <li>
109 /// <p><code>ipv6-cidr-block-association.association-id</code> - An association ID for an IPv6 CIDR block associated with the subnet.</p></li>
110 /// <li>
111 /// <p><code>ipv6-cidr-block-association.state</code> - The state of an IPv6 CIDR block associated with the subnet.</p></li>
112 /// <li>
113 /// <p><code>ipv6-native</code> - Indicates whether this is an IPv6 only subnet (<code>true</code> | <code>false</code>).</p></li>
114 /// <li>
115 /// <p><code>map-customer-owned-ip-on-launch</code> - Indicates whether a network interface created in this subnet (including a network interface created by <code>RunInstances</code>) receives a customer-owned IPv4 address.</p></li>
116 /// <li>
117 /// <p><code>map-public-ip-on-launch</code> - Indicates whether instances launched in this subnet receive a public IPv4 address.</p></li>
118 /// <li>
119 /// <p><code>outpost-arn</code> - The Amazon Resource Name (ARN) of the Outpost.</p></li>
120 /// <li>
121 /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the subnet.</p></li>
122 /// <li>
123 /// <p><code>private-dns-name-options-on-launch.hostname-type</code> - 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></li>
124 /// <li>
125 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-a-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p></li>
126 /// <li>
127 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-aaaa-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p></li>
128 /// <li>
129 /// <p><code>state</code> - The state of the subnet (<code>pending</code> | <code>available</code>).</p></li>
130 /// <li>
131 /// <p><code>subnet-arn</code> - The Amazon Resource Name (ARN) of the subnet.</p></li>
132 /// <li>
133 /// <p><code>subnet-id</code> - The ID of the subnet.</p></li>
134 /// <li>
135 /// <p><code>tag</code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
136 /// <li>
137 /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
138 /// <li>
139 /// <p><code>vpc-id</code> - The ID of the VPC for the subnet.</p></li>
140 /// </ul>
141 pub fn filters(mut self, input: crate::types::Filter) -> Self {
142 self.inner = self.inner.filters(input);
143 self
144 }
145 /// <p>The filters.</p>
146 /// <ul>
147 /// <li>
148 /// <p><code>availability-zone</code> - The Availability Zone for the subnet. You can also use <code>availabilityZone</code> as the filter name.</p></li>
149 /// <li>
150 /// <p><code>availability-zone-id</code> - The ID of the Availability Zone for the subnet. You can also use <code>availabilityZoneId</code> as the filter name.</p></li>
151 /// <li>
152 /// <p><code>available-ip-address-count</code> - The number of IPv4 addresses in the subnet that are available.</p></li>
153 /// <li>
154 /// <p><code>cidr-block</code> - The IPv4 CIDR block of the subnet. The CIDR block you specify must exactly match the subnet's CIDR block for information to be returned for the subnet. You can also use <code>cidr</code> or <code>cidrBlock</code> as the filter names.</p></li>
155 /// <li>
156 /// <p><code>customer-owned-ipv4-pool</code> - The customer-owned IPv4 address pool associated with the subnet.</p></li>
157 /// <li>
158 /// <p><code>default-for-az</code> - Indicates whether this is the default subnet for the Availability Zone (<code>true</code> | <code>false</code>). You can also use <code>defaultForAz</code> as the filter name.</p></li>
159 /// <li>
160 /// <p><code>enable-dns64</code> - Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p></li>
161 /// <li>
162 /// <p><code>enable-lni-at-device-index</code> - 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).</p></li>
163 /// <li>
164 /// <p><code>ipv6-cidr-block-association.ipv6-cidr-block</code> - An IPv6 CIDR block associated with the subnet.</p></li>
165 /// <li>
166 /// <p><code>ipv6-cidr-block-association.association-id</code> - An association ID for an IPv6 CIDR block associated with the subnet.</p></li>
167 /// <li>
168 /// <p><code>ipv6-cidr-block-association.state</code> - The state of an IPv6 CIDR block associated with the subnet.</p></li>
169 /// <li>
170 /// <p><code>ipv6-native</code> - Indicates whether this is an IPv6 only subnet (<code>true</code> | <code>false</code>).</p></li>
171 /// <li>
172 /// <p><code>map-customer-owned-ip-on-launch</code> - Indicates whether a network interface created in this subnet (including a network interface created by <code>RunInstances</code>) receives a customer-owned IPv4 address.</p></li>
173 /// <li>
174 /// <p><code>map-public-ip-on-launch</code> - Indicates whether instances launched in this subnet receive a public IPv4 address.</p></li>
175 /// <li>
176 /// <p><code>outpost-arn</code> - The Amazon Resource Name (ARN) of the Outpost.</p></li>
177 /// <li>
178 /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the subnet.</p></li>
179 /// <li>
180 /// <p><code>private-dns-name-options-on-launch.hostname-type</code> - 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></li>
181 /// <li>
182 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-a-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p></li>
183 /// <li>
184 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-aaaa-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p></li>
185 /// <li>
186 /// <p><code>state</code> - The state of the subnet (<code>pending</code> | <code>available</code>).</p></li>
187 /// <li>
188 /// <p><code>subnet-arn</code> - The Amazon Resource Name (ARN) of the subnet.</p></li>
189 /// <li>
190 /// <p><code>subnet-id</code> - The ID of the subnet.</p></li>
191 /// <li>
192 /// <p><code>tag</code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
193 /// <li>
194 /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
195 /// <li>
196 /// <p><code>vpc-id</code> - The ID of the VPC for the subnet.</p></li>
197 /// </ul>
198 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
199 self.inner = self.inner.set_filters(input);
200 self
201 }
202 /// <p>The filters.</p>
203 /// <ul>
204 /// <li>
205 /// <p><code>availability-zone</code> - The Availability Zone for the subnet. You can also use <code>availabilityZone</code> as the filter name.</p></li>
206 /// <li>
207 /// <p><code>availability-zone-id</code> - The ID of the Availability Zone for the subnet. You can also use <code>availabilityZoneId</code> as the filter name.</p></li>
208 /// <li>
209 /// <p><code>available-ip-address-count</code> - The number of IPv4 addresses in the subnet that are available.</p></li>
210 /// <li>
211 /// <p><code>cidr-block</code> - The IPv4 CIDR block of the subnet. The CIDR block you specify must exactly match the subnet's CIDR block for information to be returned for the subnet. You can also use <code>cidr</code> or <code>cidrBlock</code> as the filter names.</p></li>
212 /// <li>
213 /// <p><code>customer-owned-ipv4-pool</code> - The customer-owned IPv4 address pool associated with the subnet.</p></li>
214 /// <li>
215 /// <p><code>default-for-az</code> - Indicates whether this is the default subnet for the Availability Zone (<code>true</code> | <code>false</code>). You can also use <code>defaultForAz</code> as the filter name.</p></li>
216 /// <li>
217 /// <p><code>enable-dns64</code> - Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.</p></li>
218 /// <li>
219 /// <p><code>enable-lni-at-device-index</code> - 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).</p></li>
220 /// <li>
221 /// <p><code>ipv6-cidr-block-association.ipv6-cidr-block</code> - An IPv6 CIDR block associated with the subnet.</p></li>
222 /// <li>
223 /// <p><code>ipv6-cidr-block-association.association-id</code> - An association ID for an IPv6 CIDR block associated with the subnet.</p></li>
224 /// <li>
225 /// <p><code>ipv6-cidr-block-association.state</code> - The state of an IPv6 CIDR block associated with the subnet.</p></li>
226 /// <li>
227 /// <p><code>ipv6-native</code> - Indicates whether this is an IPv6 only subnet (<code>true</code> | <code>false</code>).</p></li>
228 /// <li>
229 /// <p><code>map-customer-owned-ip-on-launch</code> - Indicates whether a network interface created in this subnet (including a network interface created by <code>RunInstances</code>) receives a customer-owned IPv4 address.</p></li>
230 /// <li>
231 /// <p><code>map-public-ip-on-launch</code> - Indicates whether instances launched in this subnet receive a public IPv4 address.</p></li>
232 /// <li>
233 /// <p><code>outpost-arn</code> - The Amazon Resource Name (ARN) of the Outpost.</p></li>
234 /// <li>
235 /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the subnet.</p></li>
236 /// <li>
237 /// <p><code>private-dns-name-options-on-launch.hostname-type</code> - 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></li>
238 /// <li>
239 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-a-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS A records.</p></li>
240 /// <li>
241 /// <p><code>private-dns-name-options-on-launch.enable-resource-name-dns-aaaa-record</code> - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.</p></li>
242 /// <li>
243 /// <p><code>state</code> - The state of the subnet (<code>pending</code> | <code>available</code>).</p></li>
244 /// <li>
245 /// <p><code>subnet-arn</code> - The Amazon Resource Name (ARN) of the subnet.</p></li>
246 /// <li>
247 /// <p><code>subnet-id</code> - The ID of the subnet.</p></li>
248 /// <li>
249 /// <p><code>tag</code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
250 /// <li>
251 /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
252 /// <li>
253 /// <p><code>vpc-id</code> - The ID of the VPC for the subnet.</p></li>
254 /// </ul>
255 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
256 self.inner.get_filters()
257 }
258 ///
259 /// Appends an item to `SubnetIds`.
260 ///
261 /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
262 ///
263 /// <p>The IDs of the subnets.</p>
264 /// <p>Default: Describes all your subnets.</p>
265 pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266 self.inner = self.inner.subnet_ids(input.into());
267 self
268 }
269 /// <p>The IDs of the subnets.</p>
270 /// <p>Default: Describes all your subnets.</p>
271 pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
272 self.inner = self.inner.set_subnet_ids(input);
273 self
274 }
275 /// <p>The IDs of the subnets.</p>
276 /// <p>Default: Describes all your subnets.</p>
277 pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
278 self.inner.get_subnet_ids()
279 }
280 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
281 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282 self.inner = self.inner.next_token(input.into());
283 self
284 }
285 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
286 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
287 self.inner = self.inner.set_next_token(input);
288 self
289 }
290 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
291 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
292 self.inner.get_next_token()
293 }
294 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
295 pub fn max_results(mut self, input: i32) -> Self {
296 self.inner = self.inner.max_results(input);
297 self
298 }
299 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
300 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
301 self.inner = self.inner.set_max_results(input);
302 self
303 }
304 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
305 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
306 self.inner.get_max_results()
307 }
308 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
309 pub fn dry_run(mut self, input: bool) -> Self {
310 self.inner = self.inner.dry_run(input);
311 self
312 }
313 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
314 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
315 self.inner = self.inner.set_dry_run(input);
316 self
317 }
318 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
319 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
320 self.inner.get_dry_run()
321 }
322}
323
324/// Successful return type for the `subnet_available` waiter.
325pub type SubnetAvailableFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
326 crate::operation::describe_subnets::DescribeSubnetsOutput,
327 ::aws_smithy_runtime_api::client::result::SdkError<
328 crate::operation::describe_subnets::DescribeSubnetsError,
329 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
330 >,
331>;
332
333/// Error type for the `subnet_available` waiter.
334pub type WaitUntilSubnetAvailableError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
335 crate::operation::describe_subnets::DescribeSubnetsOutput,
336 crate::operation::describe_subnets::DescribeSubnetsError,
337>;