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.</p>
26/// <p>A VPC must have an associated IPv4 CIDR block. You can choose an IPv4 CIDR block or an IPAM-allocated IPv4 CIDR block. You can optionally associate an IPv6 CIDR block with a VPC. You can choose an IPv6 CIDR block, an Amazon-provided IPv6 CIDR block, an IPAM-allocated IPv6 CIDR block, or an IPv6 CIDR block that you brought to Amazon Web Services. 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>
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 DNS options and tenancy for a VPC when you create it. You can't change the tenancy of a VPC after you create it. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/create-vpc-options.html">VPC configuration options</a> in the <i>Amazon VPC 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    /// <p>Specifies the encryption control configuration to apply to the VPC during creation. VPC Encryption Control enables you to enforce encryption for all data in transit within and between VPCs to meet compliance requirements.</p>
227    /// <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-encryption-controls.html">Enforce VPC encryption in transit</a> in the <i>Amazon VPC User Guide</i>.</p>
228    pub fn vpc_encryption_control(mut self, input: crate::types::VpcEncryptionControlConfiguration) -> Self {
229        self.inner = self.inner.vpc_encryption_control(input);
230        self
231    }
232    /// <p>Specifies the encryption control configuration to apply to the VPC during creation. VPC Encryption Control enables you to enforce encryption for all data in transit within and between VPCs to meet compliance requirements.</p>
233    /// <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-encryption-controls.html">Enforce VPC encryption in transit</a> in the <i>Amazon VPC User Guide</i>.</p>
234    pub fn set_vpc_encryption_control(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControlConfiguration>) -> Self {
235        self.inner = self.inner.set_vpc_encryption_control(input);
236        self
237    }
238    /// <p>Specifies the encryption control configuration to apply to the VPC during creation. VPC Encryption Control enables you to enforce encryption for all data in transit within and between VPCs to meet compliance requirements.</p>
239    /// <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-encryption-controls.html">Enforce VPC encryption in transit</a> in the <i>Amazon VPC User Guide</i>.</p>
240    pub fn get_vpc_encryption_control(&self) -> &::std::option::Option<crate::types::VpcEncryptionControlConfiguration> {
241        self.inner.get_vpc_encryption_control()
242    }
243    ///
244    /// Appends an item to `TagSpecifications`.
245    ///
246    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
247    ///
248    /// <p>The tags to assign to the VPC.</p>
249    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
250        self.inner = self.inner.tag_specifications(input);
251        self
252    }
253    /// <p>The tags to assign to the VPC.</p>
254    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
255        self.inner = self.inner.set_tag_specifications(input);
256        self
257    }
258    /// <p>The tags to assign to the VPC.</p>
259    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
260        self.inner.get_tag_specifications()
261    }
262    /// <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>
263    pub fn dry_run(mut self, input: bool) -> Self {
264        self.inner = self.inner.dry_run(input);
265        self
266    }
267    /// <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>
268    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
269        self.inner = self.inner.set_dry_run(input);
270        self
271    }
272    /// <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>
273    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
274        self.inner.get_dry_run()
275    }
276    /// <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>
277    /// <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>
278    /// <p>Default: <code>default</code></p>
279    pub fn instance_tenancy(mut self, input: crate::types::Tenancy) -> Self {
280        self.inner = self.inner.instance_tenancy(input);
281        self
282    }
283    /// <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>
284    /// <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>
285    /// <p>Default: <code>default</code></p>
286    pub fn set_instance_tenancy(mut self, input: ::std::option::Option<crate::types::Tenancy>) -> Self {
287        self.inner = self.inner.set_instance_tenancy(input);
288        self
289    }
290    /// <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>
291    /// <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>
292    /// <p>Default: <code>default</code></p>
293    pub fn get_instance_tenancy(&self) -> &::std::option::Option<crate::types::Tenancy> {
294        self.inner.get_instance_tenancy()
295    }
296    /// <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>
297    pub fn amazon_provided_ipv6_cidr_block(mut self, input: bool) -> Self {
298        self.inner = self.inner.amazon_provided_ipv6_cidr_block(input);
299        self
300    }
301    /// <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>
302    pub fn set_amazon_provided_ipv6_cidr_block(mut self, input: ::std::option::Option<bool>) -> Self {
303        self.inner = self.inner.set_amazon_provided_ipv6_cidr_block(input);
304        self
305    }
306    /// <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>
307    pub fn get_amazon_provided_ipv6_cidr_block(&self) -> &::std::option::Option<bool> {
308        self.inner.get_amazon_provided_ipv6_cidr_block()
309    }
310}