aws_sdk_route53/operation/create_hosted_zone/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_hosted_zone::_create_hosted_zone_output::CreateHostedZoneOutputBuilder;
3
4pub use crate::operation::create_hosted_zone::_create_hosted_zone_input::CreateHostedZoneInputBuilder;
5
6impl crate::operation::create_hosted_zone::builders::CreateHostedZoneInputBuilder {
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_hosted_zone::CreateHostedZoneOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_hosted_zone::CreateHostedZoneError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_hosted_zone();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateHostedZone`.
24///
25/// <p>Creates a new public or private hosted zone. You create records in a public hosted zone to define how you want to route traffic on the internet for a domain, such as example.com, and its subdomains (apex.example.com, acme.example.com). You create records in a private hosted zone to define how you want to route traffic for a domain and its subdomains within one or more Amazon Virtual Private Clouds (Amazon VPCs).</p><important>
26/// <p>You can't convert a public hosted zone to a private hosted zone or vice versa. Instead, you must create a new hosted zone with the same name and create new resource record sets.</p>
27/// </important>
28/// <p>For more information about charges for hosted zones, see <a href="http://aws.amazon.com/route53/pricing/">Amazon Route 53 Pricing</a>.</p>
29/// <p>Note the following:</p>
30/// <ul>
31/// <li>
32/// <p>You can't create a hosted zone for a top-level domain (TLD) such as .com.</p></li>
33/// <li>
34/// <p>For public hosted zones, Route 53 automatically creates a default SOA record and four NS records for the zone. For more information about SOA and NS records, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/SOA-NSrecords.html">NS and SOA Records that Route 53 Creates for a Hosted Zone</a> in the <i>Amazon Route 53 Developer Guide</i>.</p>
35/// <p>If you want to use the same name servers for multiple public hosted zones, you can optionally associate a reusable delegation set with the hosted zone. See the <code>DelegationSetId</code> element.</p></li>
36/// <li>
37/// <p>If your domain is registered with a registrar other than Route 53, you must update the name servers with your registrar to make Route 53 the DNS service for the domain. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html">Migrating DNS Service for an Existing Domain to Amazon Route 53</a> in the <i>Amazon Route 53 Developer Guide</i>.</p></li>
38/// </ul>
39/// <p>When you submit a <code>CreateHostedZone</code> request, the initial status of the hosted zone is <code>PENDING</code>. For public hosted zones, this means that the NS and SOA records are not yet available on all Route 53 DNS servers. When the NS and SOA records are available, the status of the zone changes to <code>INSYNC</code>.</p>
40/// <p>The <code>CreateHostedZone</code> request requires the caller to have an <code>ec2:DescribeVpcs</code> permission.</p><note>
41/// <p>When creating private hosted zones, the Amazon VPC must belong to the same partition where the hosted zone is created. A partition is a group of Amazon Web Services Regions. Each Amazon Web Services account is scoped to one partition.</p>
42/// <p>The following are the supported partitions:</p>
43/// <ul>
44/// <li>
45/// <p><code>aws</code> - Amazon Web Services Regions</p></li>
46/// <li>
47/// <p><code>aws-cn</code> - China Regions</p></li>
48/// <li>
49/// <p><code>aws-us-gov</code> - Amazon Web Services GovCloud (US) Region</p></li>
50/// </ul>
51/// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Access Management</a> in the <i>Amazon Web Services General Reference</i>.</p>
52/// </note>
53#[derive(::std::clone::Clone, ::std::fmt::Debug)]
54pub struct CreateHostedZoneFluentBuilder {
55 handle: ::std::sync::Arc<crate::client::Handle>,
56 inner: crate::operation::create_hosted_zone::builders::CreateHostedZoneInputBuilder,
57 config_override: ::std::option::Option<crate::config::Builder>,
58}
59impl
60 crate::client::customize::internal::CustomizableSend<
61 crate::operation::create_hosted_zone::CreateHostedZoneOutput,
62 crate::operation::create_hosted_zone::CreateHostedZoneError,
63 > for CreateHostedZoneFluentBuilder
64{
65 fn send(
66 self,
67 config_override: crate::config::Builder,
68 ) -> crate::client::customize::internal::BoxFuture<
69 crate::client::customize::internal::SendResult<
70 crate::operation::create_hosted_zone::CreateHostedZoneOutput,
71 crate::operation::create_hosted_zone::CreateHostedZoneError,
72 >,
73 > {
74 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
75 }
76}
77impl CreateHostedZoneFluentBuilder {
78 /// Creates a new `CreateHostedZoneFluentBuilder`.
79 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
80 Self {
81 handle,
82 inner: ::std::default::Default::default(),
83 config_override: ::std::option::Option::None,
84 }
85 }
86 /// Access the CreateHostedZone as a reference.
87 pub fn as_input(&self) -> &crate::operation::create_hosted_zone::builders::CreateHostedZoneInputBuilder {
88 &self.inner
89 }
90 /// Sends the request and returns the response.
91 ///
92 /// If an error occurs, an `SdkError` will be returned with additional details that
93 /// can be matched against.
94 ///
95 /// By default, any retryable failures will be retried twice. Retry behavior
96 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
97 /// set when configuring the client.
98 pub async fn send(
99 self,
100 ) -> ::std::result::Result<
101 crate::operation::create_hosted_zone::CreateHostedZoneOutput,
102 ::aws_smithy_runtime_api::client::result::SdkError<
103 crate::operation::create_hosted_zone::CreateHostedZoneError,
104 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
105 >,
106 > {
107 let input = self
108 .inner
109 .build()
110 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
111 let runtime_plugins = crate::operation::create_hosted_zone::CreateHostedZone::operation_runtime_plugins(
112 self.handle.runtime_plugins.clone(),
113 &self.handle.conf,
114 self.config_override,
115 );
116 crate::operation::create_hosted_zone::CreateHostedZone::orchestrate(&runtime_plugins, input).await
117 }
118
119 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
120 pub fn customize(
121 self,
122 ) -> crate::client::customize::CustomizableOperation<
123 crate::operation::create_hosted_zone::CreateHostedZoneOutput,
124 crate::operation::create_hosted_zone::CreateHostedZoneError,
125 Self,
126 > {
127 crate::client::customize::CustomizableOperation::new(self)
128 }
129 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
130 self.set_config_override(::std::option::Option::Some(config_override.into()));
131 self
132 }
133
134 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
135 self.config_override = config_override;
136 self
137 }
138 /// <p>The name of the domain. Specify a fully qualified domain name, for example, <i>www.example.com</i>. The trailing dot is optional; Amazon Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats <i>www.example.com</i> (without a trailing dot) and <i>www.example.com.</i> (with a trailing dot) as identical.</p>
139 /// <p>If you're creating a public hosted zone, this is the name you have registered with your DNS registrar. If your domain name is registered with a registrar other than Route 53, change the name servers for your domain to the set of <code>NameServers</code> that <code>CreateHostedZone</code> returns in <code>DelegationSet</code>.</p>
140 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.inner = self.inner.name(input.into());
142 self
143 }
144 /// <p>The name of the domain. Specify a fully qualified domain name, for example, <i>www.example.com</i>. The trailing dot is optional; Amazon Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats <i>www.example.com</i> (without a trailing dot) and <i>www.example.com.</i> (with a trailing dot) as identical.</p>
145 /// <p>If you're creating a public hosted zone, this is the name you have registered with your DNS registrar. If your domain name is registered with a registrar other than Route 53, change the name servers for your domain to the set of <code>NameServers</code> that <code>CreateHostedZone</code> returns in <code>DelegationSet</code>.</p>
146 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.inner = self.inner.set_name(input);
148 self
149 }
150 /// <p>The name of the domain. Specify a fully qualified domain name, for example, <i>www.example.com</i>. The trailing dot is optional; Amazon Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats <i>www.example.com</i> (without a trailing dot) and <i>www.example.com.</i> (with a trailing dot) as identical.</p>
151 /// <p>If you're creating a public hosted zone, this is the name you have registered with your DNS registrar. If your domain name is registered with a registrar other than Route 53, change the name servers for your domain to the set of <code>NameServers</code> that <code>CreateHostedZone</code> returns in <code>DelegationSet</code>.</p>
152 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
153 self.inner.get_name()
154 }
155 /// <p>(Private hosted zones only) A complex type that contains information about the Amazon VPC that you're associating with this hosted zone.</p>
156 /// <p>You can specify only one Amazon VPC when you create a private hosted zone. If you are associating a VPC with a hosted zone with this request, the paramaters <code>VPCId</code> and <code>VPCRegion</code> are also required.</p>
157 /// <p>To associate additional Amazon VPCs with the hosted zone, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_AssociateVPCWithHostedZone.html">AssociateVPCWithHostedZone</a> after you create a hosted zone.</p>
158 pub fn vpc(mut self, input: crate::types::Vpc) -> Self {
159 self.inner = self.inner.vpc(input);
160 self
161 }
162 /// <p>(Private hosted zones only) A complex type that contains information about the Amazon VPC that you're associating with this hosted zone.</p>
163 /// <p>You can specify only one Amazon VPC when you create a private hosted zone. If you are associating a VPC with a hosted zone with this request, the paramaters <code>VPCId</code> and <code>VPCRegion</code> are also required.</p>
164 /// <p>To associate additional Amazon VPCs with the hosted zone, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_AssociateVPCWithHostedZone.html">AssociateVPCWithHostedZone</a> after you create a hosted zone.</p>
165 pub fn set_vpc(mut self, input: ::std::option::Option<crate::types::Vpc>) -> Self {
166 self.inner = self.inner.set_vpc(input);
167 self
168 }
169 /// <p>(Private hosted zones only) A complex type that contains information about the Amazon VPC that you're associating with this hosted zone.</p>
170 /// <p>You can specify only one Amazon VPC when you create a private hosted zone. If you are associating a VPC with a hosted zone with this request, the paramaters <code>VPCId</code> and <code>VPCRegion</code> are also required.</p>
171 /// <p>To associate additional Amazon VPCs with the hosted zone, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_AssociateVPCWithHostedZone.html">AssociateVPCWithHostedZone</a> after you create a hosted zone.</p>
172 pub fn get_vpc(&self) -> &::std::option::Option<crate::types::Vpc> {
173 self.inner.get_vpc()
174 }
175 /// <p>A unique string that identifies the request and that allows failed <code>CreateHostedZone</code> requests to be retried without the risk of executing the operation twice. You must use a unique <code>CallerReference</code> string every time you submit a <code>CreateHostedZone</code> request. <code>CallerReference</code> can be any unique string, for example, a date/time stamp.</p>
176 pub fn caller_reference(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177 self.inner = self.inner.caller_reference(input.into());
178 self
179 }
180 /// <p>A unique string that identifies the request and that allows failed <code>CreateHostedZone</code> requests to be retried without the risk of executing the operation twice. You must use a unique <code>CallerReference</code> string every time you submit a <code>CreateHostedZone</code> request. <code>CallerReference</code> can be any unique string, for example, a date/time stamp.</p>
181 pub fn set_caller_reference(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182 self.inner = self.inner.set_caller_reference(input);
183 self
184 }
185 /// <p>A unique string that identifies the request and that allows failed <code>CreateHostedZone</code> requests to be retried without the risk of executing the operation twice. You must use a unique <code>CallerReference</code> string every time you submit a <code>CreateHostedZone</code> request. <code>CallerReference</code> can be any unique string, for example, a date/time stamp.</p>
186 pub fn get_caller_reference(&self) -> &::std::option::Option<::std::string::String> {
187 self.inner.get_caller_reference()
188 }
189 /// <p>(Optional) A complex type that contains the following optional values:</p>
190 /// <ul>
191 /// <li>
192 /// <p>For public and private hosted zones, an optional comment</p></li>
193 /// <li>
194 /// <p>For private hosted zones, an optional <code>PrivateZone</code> element</p></li>
195 /// </ul>
196 /// <p>If you don't specify a comment or the <code>PrivateZone</code> element, omit <code>HostedZoneConfig</code> and the other elements.</p>
197 pub fn hosted_zone_config(mut self, input: crate::types::HostedZoneConfig) -> Self {
198 self.inner = self.inner.hosted_zone_config(input);
199 self
200 }
201 /// <p>(Optional) A complex type that contains the following optional values:</p>
202 /// <ul>
203 /// <li>
204 /// <p>For public and private hosted zones, an optional comment</p></li>
205 /// <li>
206 /// <p>For private hosted zones, an optional <code>PrivateZone</code> element</p></li>
207 /// </ul>
208 /// <p>If you don't specify a comment or the <code>PrivateZone</code> element, omit <code>HostedZoneConfig</code> and the other elements.</p>
209 pub fn set_hosted_zone_config(mut self, input: ::std::option::Option<crate::types::HostedZoneConfig>) -> Self {
210 self.inner = self.inner.set_hosted_zone_config(input);
211 self
212 }
213 /// <p>(Optional) A complex type that contains the following optional values:</p>
214 /// <ul>
215 /// <li>
216 /// <p>For public and private hosted zones, an optional comment</p></li>
217 /// <li>
218 /// <p>For private hosted zones, an optional <code>PrivateZone</code> element</p></li>
219 /// </ul>
220 /// <p>If you don't specify a comment or the <code>PrivateZone</code> element, omit <code>HostedZoneConfig</code> and the other elements.</p>
221 pub fn get_hosted_zone_config(&self) -> &::std::option::Option<crate::types::HostedZoneConfig> {
222 self.inner.get_hosted_zone_config()
223 }
224 /// <p>If you want to associate a reusable delegation set with this hosted zone, the ID that Amazon Route 53 assigned to the reusable delegation set when you created it. For more information about reusable delegation sets, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html">CreateReusableDelegationSet</a>.</p>
225 /// <p>If you are using a reusable delegation set to create a public hosted zone for a subdomain, make sure that the parent hosted zone doesn't use one or more of the same name servers. If you have overlapping nameservers, the operation will cause a <code>ConflictingDomainsExist</code> error.</p>
226 pub fn delegation_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227 self.inner = self.inner.delegation_set_id(input.into());
228 self
229 }
230 /// <p>If you want to associate a reusable delegation set with this hosted zone, the ID that Amazon Route 53 assigned to the reusable delegation set when you created it. For more information about reusable delegation sets, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html">CreateReusableDelegationSet</a>.</p>
231 /// <p>If you are using a reusable delegation set to create a public hosted zone for a subdomain, make sure that the parent hosted zone doesn't use one or more of the same name servers. If you have overlapping nameservers, the operation will cause a <code>ConflictingDomainsExist</code> error.</p>
232 pub fn set_delegation_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
233 self.inner = self.inner.set_delegation_set_id(input);
234 self
235 }
236 /// <p>If you want to associate a reusable delegation set with this hosted zone, the ID that Amazon Route 53 assigned to the reusable delegation set when you created it. For more information about reusable delegation sets, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html">CreateReusableDelegationSet</a>.</p>
237 /// <p>If you are using a reusable delegation set to create a public hosted zone for a subdomain, make sure that the parent hosted zone doesn't use one or more of the same name servers. If you have overlapping nameservers, the operation will cause a <code>ConflictingDomainsExist</code> error.</p>
238 pub fn get_delegation_set_id(&self) -> &::std::option::Option<::std::string::String> {
239 self.inner.get_delegation_set_id()
240 }
241}