aws_sdk_ec2/operation/create_vpc/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_vpc::_create_vpc_output::CreateVpcOutputBuilder;
3
4pub use crate::operation::create_vpc::_create_vpc_input::CreateVpcInputBuilder;
5
6impl crate::operation::create_vpc::builders::CreateVpcInputBuilder {
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_vpc::CreateVpcOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_vpc::CreateVpcError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_vpc();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateVpc`.
24///
25/// <p>Creates a VPC with the specified CIDR blocks. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html">IP addressing for your VPCs and subnets</a> in the <i>Amazon VPC User Guide</i>.</p>
26/// <p>You can optionally request an IPv6 CIDR block for the VPC. You can request an Amazon-provided IPv6 CIDR block from Amazon's pool of IPv6 addresses or an IPv6 CIDR block from an IPv6 address pool that you provisioned through bring your own IP addresses (<a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html">BYOIP</a>).</p>
27/// <p>By default, each instance that you launch in the VPC has the default DHCP options, which include only a default DNS server that we provide (AmazonProvidedDNS). For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html">DHCP option sets</a> in the <i>Amazon VPC User Guide</i>.</p>
28/// <p>You can specify the instance tenancy value for the VPC when you create it. You can't change this value for the VPC after you create it. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html">Dedicated Instances</a> in the <i>Amazon EC2 User Guide</i>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateVpcFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_vpc::builders::CreateVpcInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl crate::client::customize::internal::CustomizableSend<crate::operation::create_vpc::CreateVpcOutput, crate::operation::create_vpc::CreateVpcError>
36 for CreateVpcFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<crate::operation::create_vpc::CreateVpcOutput, crate::operation::create_vpc::CreateVpcError>,
43 > {
44 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45 }
46}
47impl CreateVpcFluentBuilder {
48 /// Creates a new `CreateVpcFluentBuilder`.
49 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50 Self {
51 handle,
52 inner: ::std::default::Default::default(),
53 config_override: ::std::option::Option::None,
54 }
55 }
56 /// Access the CreateVpc as a reference.
57 pub fn as_input(&self) -> &crate::operation::create_vpc::builders::CreateVpcInputBuilder {
58 &self.inner
59 }
60 /// Sends the request and returns the response.
61 ///
62 /// If an error occurs, an `SdkError` will be returned with additional details that
63 /// can be matched against.
64 ///
65 /// By default, any retryable failures will be retried twice. Retry behavior
66 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67 /// set when configuring the client.
68 pub async fn send(
69 self,
70 ) -> ::std::result::Result<
71 crate::operation::create_vpc::CreateVpcOutput,
72 ::aws_smithy_runtime_api::client::result::SdkError<
73 crate::operation::create_vpc::CreateVpcError,
74 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
75 >,
76 > {
77 let input = self
78 .inner
79 .build()
80 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
81 let runtime_plugins = crate::operation::create_vpc::CreateVpc::operation_runtime_plugins(
82 self.handle.runtime_plugins.clone(),
83 &self.handle.conf,
84 self.config_override,
85 );
86 crate::operation::create_vpc::CreateVpc::orchestrate(&runtime_plugins, input).await
87 }
88
89 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
90 pub fn customize(
91 self,
92 ) -> crate::client::customize::CustomizableOperation<
93 crate::operation::create_vpc::CreateVpcOutput,
94 crate::operation::create_vpc::CreateVpcError,
95 Self,
96 > {
97 crate::client::customize::CustomizableOperation::new(self)
98 }
99 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
100 self.set_config_override(::std::option::Option::Some(config_override.into()));
101 self
102 }
103
104 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
105 self.config_override = config_override;
106 self
107 }
108 /// <p>The IPv4 network range for the VPC, in CIDR notation. For example, <code>10.0.0.0/16</code>. We modify the specified CIDR block to its canonical form; for example, if you specify <code>100.68.0.18/18</code>, we modify it to <code>100.68.0.0/18</code>.</p>
109 pub fn cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110 self.inner = self.inner.cidr_block(input.into());
111 self
112 }
113 /// <p>The IPv4 network range for the VPC, in CIDR notation. For example, <code>10.0.0.0/16</code>. We modify the specified CIDR block to its canonical form; for example, if you specify <code>100.68.0.18/18</code>, we modify it to <code>100.68.0.0/18</code>.</p>
114 pub fn set_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115 self.inner = self.inner.set_cidr_block(input);
116 self
117 }
118 /// <p>The IPv4 network range for the VPC, in CIDR notation. For example, <code>10.0.0.0/16</code>. We modify the specified CIDR block to its canonical form; for example, if you specify <code>100.68.0.18/18</code>, we modify it to <code>100.68.0.0/18</code>.</p>
119 pub fn get_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
120 self.inner.get_cidr_block()
121 }
122 /// <p>The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.</p>
123 pub fn ipv6_pool(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.inner = self.inner.ipv6_pool(input.into());
125 self
126 }
127 /// <p>The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.</p>
128 pub fn set_ipv6_pool(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.inner = self.inner.set_ipv6_pool(input);
130 self
131 }
132 /// <p>The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.</p>
133 pub fn get_ipv6_pool(&self) -> &::std::option::Option<::std::string::String> {
134 self.inner.get_ipv6_pool()
135 }
136 /// <p>The IPv6 CIDR block from the IPv6 address pool. You must also specify <code>Ipv6Pool</code> in the request.</p>
137 /// <p>To let Amazon choose the IPv6 CIDR block for you, omit this parameter.</p>
138 pub fn ipv6_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139 self.inner = self.inner.ipv6_cidr_block(input.into());
140 self
141 }
142 /// <p>The IPv6 CIDR block from the IPv6 address pool. You must also specify <code>Ipv6Pool</code> in the request.</p>
143 /// <p>To let Amazon choose the IPv6 CIDR block for you, omit this parameter.</p>
144 pub fn set_ipv6_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.inner = self.inner.set_ipv6_cidr_block(input);
146 self
147 }
148 /// <p>The IPv6 CIDR block from the IPv6 address pool. You must also specify <code>Ipv6Pool</code> in the request.</p>
149 /// <p>To let Amazon choose the IPv6 CIDR block for you, omit this parameter.</p>
150 pub fn get_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_ipv6_cidr_block()
152 }
153 /// <p>The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
154 pub fn ipv4_ipam_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155 self.inner = self.inner.ipv4_ipam_pool_id(input.into());
156 self
157 }
158 /// <p>The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
159 pub fn set_ipv4_ipam_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160 self.inner = self.inner.set_ipv4_ipam_pool_id(input);
161 self
162 }
163 /// <p>The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
164 pub fn get_ipv4_ipam_pool_id(&self) -> &::std::option::Option<::std::string::String> {
165 self.inner.get_ipv4_ipam_pool_id()
166 }
167 /// <p>The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
168 pub fn ipv4_netmask_length(mut self, input: i32) -> Self {
169 self.inner = self.inner.ipv4_netmask_length(input);
170 self
171 }
172 /// <p>The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
173 pub fn set_ipv4_netmask_length(mut self, input: ::std::option::Option<i32>) -> Self {
174 self.inner = self.inner.set_ipv4_netmask_length(input);
175 self
176 }
177 /// <p>The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
178 pub fn get_ipv4_netmask_length(&self) -> &::std::option::Option<i32> {
179 self.inner.get_ipv4_netmask_length()
180 }
181 /// <p>The ID of an IPv6 IPAM pool which will be used to allocate this VPC an IPv6 CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across Amazon Web Services Regions and accounts throughout your Amazon Web Services Organization. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
182 pub fn ipv6_ipam_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183 self.inner = self.inner.ipv6_ipam_pool_id(input.into());
184 self
185 }
186 /// <p>The ID of an IPv6 IPAM pool which will be used to allocate this VPC an IPv6 CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across Amazon Web Services Regions and accounts throughout your Amazon Web Services Organization. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
187 pub fn set_ipv6_ipam_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188 self.inner = self.inner.set_ipv6_ipam_pool_id(input);
189 self
190 }
191 /// <p>The ID of an IPv6 IPAM pool which will be used to allocate this VPC an IPv6 CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across Amazon Web Services Regions and accounts throughout your Amazon Web Services Organization. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
192 pub fn get_ipv6_ipam_pool_id(&self) -> &::std::option::Option<::std::string::String> {
193 self.inner.get_ipv6_ipam_pool_id()
194 }
195 /// <p>The netmask length of the IPv6 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
196 pub fn ipv6_netmask_length(mut self, input: i32) -> Self {
197 self.inner = self.inner.ipv6_netmask_length(input);
198 self
199 }
200 /// <p>The netmask length of the IPv6 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
201 pub fn set_ipv6_netmask_length(mut self, input: ::std::option::Option<i32>) -> Self {
202 self.inner = self.inner.set_ipv6_netmask_length(input);
203 self
204 }
205 /// <p>The netmask length of the IPv6 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
206 pub fn get_ipv6_netmask_length(&self) -> &::std::option::Option<i32> {
207 self.inner.get_ipv6_netmask_length()
208 }
209 /// <p>The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the address to this location.</p>
210 /// <p>You must set <code>AmazonProvidedIpv6CidrBlock</code> to <code>true</code> to use this parameter.</p>
211 pub fn ipv6_cidr_block_network_border_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212 self.inner = self.inner.ipv6_cidr_block_network_border_group(input.into());
213 self
214 }
215 /// <p>The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the address to this location.</p>
216 /// <p>You must set <code>AmazonProvidedIpv6CidrBlock</code> to <code>true</code> to use this parameter.</p>
217 pub fn set_ipv6_cidr_block_network_border_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218 self.inner = self.inner.set_ipv6_cidr_block_network_border_group(input);
219 self
220 }
221 /// <p>The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the address to this location.</p>
222 /// <p>You must set <code>AmazonProvidedIpv6CidrBlock</code> to <code>true</code> to use this parameter.</p>
223 pub fn get_ipv6_cidr_block_network_border_group(&self) -> &::std::option::Option<::std::string::String> {
224 self.inner.get_ipv6_cidr_block_network_border_group()
225 }
226 ///
227 /// Appends an item to `TagSpecifications`.
228 ///
229 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
230 ///
231 /// <p>The tags to assign to the VPC.</p>
232 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
233 self.inner = self.inner.tag_specifications(input);
234 self
235 }
236 /// <p>The tags to assign to the VPC.</p>
237 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
238 self.inner = self.inner.set_tag_specifications(input);
239 self
240 }
241 /// <p>The tags to assign to the VPC.</p>
242 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
243 self.inner.get_tag_specifications()
244 }
245 /// <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>
246 pub fn dry_run(mut self, input: bool) -> Self {
247 self.inner = self.inner.dry_run(input);
248 self
249 }
250 /// <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>
251 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
252 self.inner = self.inner.set_dry_run(input);
253 self
254 }
255 /// <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>
256 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
257 self.inner.get_dry_run()
258 }
259 /// <p>The tenancy options for instances launched into the VPC. For <code>default</code>, instances are launched with shared tenancy by default. You can launch instances with any tenancy into a shared tenancy VPC. For <code>dedicated</code>, instances are launched as dedicated tenancy instances by default. You can only launch instances with a tenancy of <code>dedicated</code> or <code>host</code> into a dedicated tenancy VPC.</p>
260 /// <p><b>Important:</b> The <code>host</code> value cannot be used with this parameter. Use the <code>default</code> or <code>dedicated</code> values only.</p>
261 /// <p>Default: <code>default</code></p>
262 pub fn instance_tenancy(mut self, input: crate::types::Tenancy) -> Self {
263 self.inner = self.inner.instance_tenancy(input);
264 self
265 }
266 /// <p>The tenancy options for instances launched into the VPC. For <code>default</code>, instances are launched with shared tenancy by default. You can launch instances with any tenancy into a shared tenancy VPC. For <code>dedicated</code>, instances are launched as dedicated tenancy instances by default. You can only launch instances with a tenancy of <code>dedicated</code> or <code>host</code> into a dedicated tenancy VPC.</p>
267 /// <p><b>Important:</b> The <code>host</code> value cannot be used with this parameter. Use the <code>default</code> or <code>dedicated</code> values only.</p>
268 /// <p>Default: <code>default</code></p>
269 pub fn set_instance_tenancy(mut self, input: ::std::option::Option<crate::types::Tenancy>) -> Self {
270 self.inner = self.inner.set_instance_tenancy(input);
271 self
272 }
273 /// <p>The tenancy options for instances launched into the VPC. For <code>default</code>, instances are launched with shared tenancy by default. You can launch instances with any tenancy into a shared tenancy VPC. For <code>dedicated</code>, instances are launched as dedicated tenancy instances by default. You can only launch instances with a tenancy of <code>dedicated</code> or <code>host</code> into a dedicated tenancy VPC.</p>
274 /// <p><b>Important:</b> The <code>host</code> value cannot be used with this parameter. Use the <code>default</code> or <code>dedicated</code> values only.</p>
275 /// <p>Default: <code>default</code></p>
276 pub fn get_instance_tenancy(&self) -> &::std::option::Option<crate::types::Tenancy> {
277 self.inner.get_instance_tenancy()
278 }
279 /// <p>Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block.</p>
280 pub fn amazon_provided_ipv6_cidr_block(mut self, input: bool) -> Self {
281 self.inner = self.inner.amazon_provided_ipv6_cidr_block(input);
282 self
283 }
284 /// <p>Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block.</p>
285 pub fn set_amazon_provided_ipv6_cidr_block(mut self, input: ::std::option::Option<bool>) -> Self {
286 self.inner = self.inner.set_amazon_provided_ipv6_cidr_block(input);
287 self
288 }
289 /// <p>Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block.</p>
290 pub fn get_amazon_provided_ipv6_cidr_block(&self) -> &::std::option::Option<bool> {
291 self.inner.get_amazon_provided_ipv6_cidr_block()
292 }
293}