aws_sdk_rds/operation/create_global_cluster/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_global_cluster::_create_global_cluster_output::CreateGlobalClusterOutputBuilder;
3
4pub use crate::operation::create_global_cluster::_create_global_cluster_input::CreateGlobalClusterInputBuilder;
5
6impl crate::operation::create_global_cluster::builders::CreateGlobalClusterInputBuilder {
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_global_cluster::CreateGlobalClusterOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_global_cluster::CreateGlobalClusterError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_global_cluster();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateGlobalCluster`.
24///
25/// <p>Creates an Aurora global database spread across multiple Amazon Web Services Regions. The global database contains a single primary cluster with read-write capability, and a read-only secondary cluster that receives data from the primary cluster through high-speed replication performed by the Aurora storage subsystem.</p>
26/// <p>You can create a global database that is initially empty, and then create the primary and secondary DB clusters in the global database. Or you can specify an existing Aurora cluster during the create operation, and this cluster becomes the primary cluster of the global database.</p><note>
27/// <p>This operation applies only to Aurora DB clusters.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateGlobalClusterFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_global_cluster::builders::CreateGlobalClusterInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::create_global_cluster::CreateGlobalClusterOutput,
38 crate::operation::create_global_cluster::CreateGlobalClusterError,
39 > for CreateGlobalClusterFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::create_global_cluster::CreateGlobalClusterOutput,
47 crate::operation::create_global_cluster::CreateGlobalClusterError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl CreateGlobalClusterFluentBuilder {
54 /// Creates a new `CreateGlobalClusterFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the CreateGlobalCluster as a reference.
63 pub fn as_input(&self) -> &crate::operation::create_global_cluster::builders::CreateGlobalClusterInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::create_global_cluster::CreateGlobalClusterOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::create_global_cluster::CreateGlobalClusterError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_global_cluster::CreateGlobalCluster::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_global_cluster::CreateGlobalCluster::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::create_global_cluster::CreateGlobalClusterOutput,
100 crate::operation::create_global_cluster::CreateGlobalClusterError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>The cluster identifier for this global database cluster. This parameter is stored as a lowercase string.</p>
115 pub fn global_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.global_cluster_identifier(input.into());
117 self
118 }
119 /// <p>The cluster identifier for this global database cluster. This parameter is stored as a lowercase string.</p>
120 pub fn set_global_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_global_cluster_identifier(input);
122 self
123 }
124 /// <p>The cluster identifier for this global database cluster. This parameter is stored as a lowercase string.</p>
125 pub fn get_global_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_global_cluster_identifier()
127 }
128 /// <p>The Amazon Resource Name (ARN) to use as the primary cluster of the global database.</p>
129 /// <p>If you provide a value for this parameter, don't specify values for the following settings because Amazon Aurora uses the values from the specified source DB cluster:</p>
130 /// <ul>
131 /// <li>
132 /// <p><code>DatabaseName</code></p></li>
133 /// <li>
134 /// <p><code>Engine</code></p></li>
135 /// <li>
136 /// <p><code>EngineVersion</code></p></li>
137 /// <li>
138 /// <p><code>StorageEncrypted</code></p></li>
139 /// </ul>
140 pub fn source_db_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.inner = self.inner.source_db_cluster_identifier(input.into());
142 self
143 }
144 /// <p>The Amazon Resource Name (ARN) to use as the primary cluster of the global database.</p>
145 /// <p>If you provide a value for this parameter, don't specify values for the following settings because Amazon Aurora uses the values from the specified source DB cluster:</p>
146 /// <ul>
147 /// <li>
148 /// <p><code>DatabaseName</code></p></li>
149 /// <li>
150 /// <p><code>Engine</code></p></li>
151 /// <li>
152 /// <p><code>EngineVersion</code></p></li>
153 /// <li>
154 /// <p><code>StorageEncrypted</code></p></li>
155 /// </ul>
156 pub fn set_source_db_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.inner = self.inner.set_source_db_cluster_identifier(input);
158 self
159 }
160 /// <p>The Amazon Resource Name (ARN) to use as the primary cluster of the global database.</p>
161 /// <p>If you provide a value for this parameter, don't specify values for the following settings because Amazon Aurora uses the values from the specified source DB cluster:</p>
162 /// <ul>
163 /// <li>
164 /// <p><code>DatabaseName</code></p></li>
165 /// <li>
166 /// <p><code>Engine</code></p></li>
167 /// <li>
168 /// <p><code>EngineVersion</code></p></li>
169 /// <li>
170 /// <p><code>StorageEncrypted</code></p></li>
171 /// </ul>
172 pub fn get_source_db_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
173 self.inner.get_source_db_cluster_identifier()
174 }
175 /// <p>The database engine to use for this global database cluster.</p>
176 /// <p>Valid Values: <code>aurora-mysql | aurora-postgresql</code></p>
177 /// <p>Constraints:</p>
178 /// <ul>
179 /// <li>
180 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the engine of the source DB cluster.</p></li>
181 /// </ul>
182 pub fn engine(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183 self.inner = self.inner.engine(input.into());
184 self
185 }
186 /// <p>The database engine to use for this global database cluster.</p>
187 /// <p>Valid Values: <code>aurora-mysql | aurora-postgresql</code></p>
188 /// <p>Constraints:</p>
189 /// <ul>
190 /// <li>
191 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the engine of the source DB cluster.</p></li>
192 /// </ul>
193 pub fn set_engine(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.inner = self.inner.set_engine(input);
195 self
196 }
197 /// <p>The database engine to use for this global database cluster.</p>
198 /// <p>Valid Values: <code>aurora-mysql | aurora-postgresql</code></p>
199 /// <p>Constraints:</p>
200 /// <ul>
201 /// <li>
202 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the engine of the source DB cluster.</p></li>
203 /// </ul>
204 pub fn get_engine(&self) -> &::std::option::Option<::std::string::String> {
205 self.inner.get_engine()
206 }
207 /// <p>The engine version to use for this global database cluster.</p>
208 /// <p>Constraints:</p>
209 /// <ul>
210 /// <li>
211 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the engine version of the source DB cluster.</p></li>
212 /// </ul>
213 pub fn engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214 self.inner = self.inner.engine_version(input.into());
215 self
216 }
217 /// <p>The engine version to use for this global database cluster.</p>
218 /// <p>Constraints:</p>
219 /// <ul>
220 /// <li>
221 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the engine version of the source DB cluster.</p></li>
222 /// </ul>
223 pub fn set_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224 self.inner = self.inner.set_engine_version(input);
225 self
226 }
227 /// <p>The engine version to use for this global database cluster.</p>
228 /// <p>Constraints:</p>
229 /// <ul>
230 /// <li>
231 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the engine version of the source DB cluster.</p></li>
232 /// </ul>
233 pub fn get_engine_version(&self) -> &::std::option::Option<::std::string::String> {
234 self.inner.get_engine_version()
235 }
236 /// <p>The life cycle type for this global database cluster.</p><note>
237 /// <p>By default, this value is set to <code>open-source-rds-extended-support</code>, which enrolls your global cluster into Amazon RDS Extended Support. At the end of standard support, you can avoid charges for Extended Support by setting the value to <code>open-source-rds-extended-support-disabled</code>. In this case, creating the global cluster will fail if the DB major version is past its end of standard support date.</p>
238 /// </note>
239 /// <p>This setting only applies to Aurora PostgreSQL-based global databases.</p>
240 /// <p>You can use this setting to enroll your global cluster into Amazon RDS Extended Support. With RDS Extended Support, you can run the selected major engine version on your global cluster past the end of standard support for that engine version. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/extended-support.html">Amazon RDS Extended Support with Amazon Aurora</a> in the <i>Amazon Aurora User Guide</i>.</p>
241 /// <p>Valid Values: <code>open-source-rds-extended-support | open-source-rds-extended-support-disabled</code></p>
242 /// <p>Default: <code>open-source-rds-extended-support</code></p>
243 pub fn engine_lifecycle_support(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.inner = self.inner.engine_lifecycle_support(input.into());
245 self
246 }
247 /// <p>The life cycle type for this global database cluster.</p><note>
248 /// <p>By default, this value is set to <code>open-source-rds-extended-support</code>, which enrolls your global cluster into Amazon RDS Extended Support. At the end of standard support, you can avoid charges for Extended Support by setting the value to <code>open-source-rds-extended-support-disabled</code>. In this case, creating the global cluster will fail if the DB major version is past its end of standard support date.</p>
249 /// </note>
250 /// <p>This setting only applies to Aurora PostgreSQL-based global databases.</p>
251 /// <p>You can use this setting to enroll your global cluster into Amazon RDS Extended Support. With RDS Extended Support, you can run the selected major engine version on your global cluster past the end of standard support for that engine version. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/extended-support.html">Amazon RDS Extended Support with Amazon Aurora</a> in the <i>Amazon Aurora User Guide</i>.</p>
252 /// <p>Valid Values: <code>open-source-rds-extended-support | open-source-rds-extended-support-disabled</code></p>
253 /// <p>Default: <code>open-source-rds-extended-support</code></p>
254 pub fn set_engine_lifecycle_support(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255 self.inner = self.inner.set_engine_lifecycle_support(input);
256 self
257 }
258 /// <p>The life cycle type for this global database cluster.</p><note>
259 /// <p>By default, this value is set to <code>open-source-rds-extended-support</code>, which enrolls your global cluster into Amazon RDS Extended Support. At the end of standard support, you can avoid charges for Extended Support by setting the value to <code>open-source-rds-extended-support-disabled</code>. In this case, creating the global cluster will fail if the DB major version is past its end of standard support date.</p>
260 /// </note>
261 /// <p>This setting only applies to Aurora PostgreSQL-based global databases.</p>
262 /// <p>You can use this setting to enroll your global cluster into Amazon RDS Extended Support. With RDS Extended Support, you can run the selected major engine version on your global cluster past the end of standard support for that engine version. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/extended-support.html">Amazon RDS Extended Support with Amazon Aurora</a> in the <i>Amazon Aurora User Guide</i>.</p>
263 /// <p>Valid Values: <code>open-source-rds-extended-support | open-source-rds-extended-support-disabled</code></p>
264 /// <p>Default: <code>open-source-rds-extended-support</code></p>
265 pub fn get_engine_lifecycle_support(&self) -> &::std::option::Option<::std::string::String> {
266 self.inner.get_engine_lifecycle_support()
267 }
268 /// <p>Specifies whether to enable deletion protection for the new global database cluster. The global database can't be deleted when deletion protection is enabled.</p>
269 pub fn deletion_protection(mut self, input: bool) -> Self {
270 self.inner = self.inner.deletion_protection(input);
271 self
272 }
273 /// <p>Specifies whether to enable deletion protection for the new global database cluster. The global database can't be deleted when deletion protection is enabled.</p>
274 pub fn set_deletion_protection(mut self, input: ::std::option::Option<bool>) -> Self {
275 self.inner = self.inner.set_deletion_protection(input);
276 self
277 }
278 /// <p>Specifies whether to enable deletion protection for the new global database cluster. The global database can't be deleted when deletion protection is enabled.</p>
279 pub fn get_deletion_protection(&self) -> &::std::option::Option<bool> {
280 self.inner.get_deletion_protection()
281 }
282 /// <p>The name for your database of up to 64 alphanumeric characters. If you don't specify a name, Amazon Aurora doesn't create a database in the global database cluster.</p>
283 /// <p>Constraints:</p>
284 /// <ul>
285 /// <li>
286 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the database name from the source DB cluster.</p></li>
287 /// </ul>
288 pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
289 self.inner = self.inner.database_name(input.into());
290 self
291 }
292 /// <p>The name for your database of up to 64 alphanumeric characters. If you don't specify a name, Amazon Aurora doesn't create a database in the global database cluster.</p>
293 /// <p>Constraints:</p>
294 /// <ul>
295 /// <li>
296 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the database name from the source DB cluster.</p></li>
297 /// </ul>
298 pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
299 self.inner = self.inner.set_database_name(input);
300 self
301 }
302 /// <p>The name for your database of up to 64 alphanumeric characters. If you don't specify a name, Amazon Aurora doesn't create a database in the global database cluster.</p>
303 /// <p>Constraints:</p>
304 /// <ul>
305 /// <li>
306 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the database name from the source DB cluster.</p></li>
307 /// </ul>
308 pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
309 self.inner.get_database_name()
310 }
311 /// <p>Specifies whether to enable storage encryption for the new global database cluster.</p>
312 /// <p>Constraints:</p>
313 /// <ul>
314 /// <li>
315 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the setting from the source DB cluster.</p></li>
316 /// </ul>
317 pub fn storage_encrypted(mut self, input: bool) -> Self {
318 self.inner = self.inner.storage_encrypted(input);
319 self
320 }
321 /// <p>Specifies whether to enable storage encryption for the new global database cluster.</p>
322 /// <p>Constraints:</p>
323 /// <ul>
324 /// <li>
325 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the setting from the source DB cluster.</p></li>
326 /// </ul>
327 pub fn set_storage_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
328 self.inner = self.inner.set_storage_encrypted(input);
329 self
330 }
331 /// <p>Specifies whether to enable storage encryption for the new global database cluster.</p>
332 /// <p>Constraints:</p>
333 /// <ul>
334 /// <li>
335 /// <p>Can't be specified if <code>SourceDBClusterIdentifier</code> is specified. In this case, Amazon Aurora uses the setting from the source DB cluster.</p></li>
336 /// </ul>
337 pub fn get_storage_encrypted(&self) -> &::std::option::Option<bool> {
338 self.inner.get_storage_encrypted()
339 }
340 ///
341 /// Appends an item to `Tags`.
342 ///
343 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
344 ///
345 /// <p>Tags to assign to the global cluster.</p>
346 pub fn tags(mut self, input: crate::types::Tag) -> Self {
347 self.inner = self.inner.tags(input);
348 self
349 }
350 /// <p>Tags to assign to the global cluster.</p>
351 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
352 self.inner = self.inner.set_tags(input);
353 self
354 }
355 /// <p>Tags to assign to the global cluster.</p>
356 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
357 self.inner.get_tags()
358 }
359}