aws_sdk_docdb/operation/create_db_instance/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_db_instance::_create_db_instance_output::CreateDbInstanceOutputBuilder;
3
4pub use crate::operation::create_db_instance::_create_db_instance_input::CreateDbInstanceInputBuilder;
5
6impl crate::operation::create_db_instance::builders::CreateDbInstanceInputBuilder {
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_db_instance::CreateDbInstanceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_db_instance::CreateDBInstanceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_db_instance();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDBInstance`.
24///
25/// <p>Creates a new instance.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateDBInstanceFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_db_instance::builders::CreateDbInstanceInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_db_instance::CreateDbInstanceOutput,
35        crate::operation::create_db_instance::CreateDBInstanceError,
36    > for CreateDBInstanceFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_db_instance::CreateDbInstanceOutput,
44            crate::operation::create_db_instance::CreateDBInstanceError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateDBInstanceFluentBuilder {
51    /// Creates a new `CreateDBInstanceFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateDBInstance as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_db_instance::builders::CreateDbInstanceInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_db_instance::CreateDbInstanceOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_db_instance::CreateDBInstanceError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_db_instance::CreateDBInstance::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_db_instance::CreateDBInstance::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_db_instance::CreateDbInstanceOutput,
97        crate::operation::create_db_instance::CreateDBInstanceError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The instance identifier. This parameter is stored as a lowercase string.</p>
112    /// <p>Constraints:</p>
113    /// <ul>
114    /// <li>
115    /// <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
116    /// <li>
117    /// <p>The first character must be a letter.</p></li>
118    /// <li>
119    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
120    /// </ul>
121    /// <p>Example: <code>mydbinstance</code></p>
122    pub fn db_instance_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.db_instance_identifier(input.into());
124        self
125    }
126    /// <p>The instance identifier. This parameter is stored as a lowercase string.</p>
127    /// <p>Constraints:</p>
128    /// <ul>
129    /// <li>
130    /// <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
131    /// <li>
132    /// <p>The first character must be a letter.</p></li>
133    /// <li>
134    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
135    /// </ul>
136    /// <p>Example: <code>mydbinstance</code></p>
137    pub fn set_db_instance_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_db_instance_identifier(input);
139        self
140    }
141    /// <p>The instance identifier. This parameter is stored as a lowercase string.</p>
142    /// <p>Constraints:</p>
143    /// <ul>
144    /// <li>
145    /// <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
146    /// <li>
147    /// <p>The first character must be a letter.</p></li>
148    /// <li>
149    /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
150    /// </ul>
151    /// <p>Example: <code>mydbinstance</code></p>
152    pub fn get_db_instance_identifier(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_db_instance_identifier()
154    }
155    /// <p>The compute and memory capacity of the instance; for example, <code>db.r5.large</code>.</p>
156    pub fn db_instance_class(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.db_instance_class(input.into());
158        self
159    }
160    /// <p>The compute and memory capacity of the instance; for example, <code>db.r5.large</code>.</p>
161    pub fn set_db_instance_class(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_db_instance_class(input);
163        self
164    }
165    /// <p>The compute and memory capacity of the instance; for example, <code>db.r5.large</code>.</p>
166    pub fn get_db_instance_class(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_db_instance_class()
168    }
169    /// <p>The name of the database engine to be used for this instance.</p>
170    /// <p>Valid value: <code>docdb</code></p>
171    pub fn engine(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.engine(input.into());
173        self
174    }
175    /// <p>The name of the database engine to be used for this instance.</p>
176    /// <p>Valid value: <code>docdb</code></p>
177    pub fn set_engine(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.inner = self.inner.set_engine(input);
179        self
180    }
181    /// <p>The name of the database engine to be used for this instance.</p>
182    /// <p>Valid value: <code>docdb</code></p>
183    pub fn get_engine(&self) -> &::std::option::Option<::std::string::String> {
184        self.inner.get_engine()
185    }
186    /// <p>The Amazon EC2 Availability Zone that the instance is created in.</p>
187    /// <p>Default: A random, system-chosen Availability Zone in the endpoint's Amazon Web Services Region.</p>
188    /// <p>Example: <code>us-east-1d</code></p>
189    pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.inner = self.inner.availability_zone(input.into());
191        self
192    }
193    /// <p>The Amazon EC2 Availability Zone that the instance is created in.</p>
194    /// <p>Default: A random, system-chosen Availability Zone in the endpoint's Amazon Web Services Region.</p>
195    /// <p>Example: <code>us-east-1d</code></p>
196    pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.inner = self.inner.set_availability_zone(input);
198        self
199    }
200    /// <p>The Amazon EC2 Availability Zone that the instance is created in.</p>
201    /// <p>Default: A random, system-chosen Availability Zone in the endpoint's Amazon Web Services Region.</p>
202    /// <p>Example: <code>us-east-1d</code></p>
203    pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
204        self.inner.get_availability_zone()
205    }
206    /// <p>The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
207    /// <p>Format: <code>ddd:hh24:mi-ddd:hh24:mi</code></p>
208    /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p>
209    /// <p>Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p>
210    /// <p>Constraints: Minimum 30-minute window.</p>
211    pub fn preferred_maintenance_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.inner = self.inner.preferred_maintenance_window(input.into());
213        self
214    }
215    /// <p>The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
216    /// <p>Format: <code>ddd:hh24:mi-ddd:hh24:mi</code></p>
217    /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p>
218    /// <p>Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p>
219    /// <p>Constraints: Minimum 30-minute window.</p>
220    pub fn set_preferred_maintenance_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.inner = self.inner.set_preferred_maintenance_window(input);
222        self
223    }
224    /// <p>The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
225    /// <p>Format: <code>ddd:hh24:mi-ddd:hh24:mi</code></p>
226    /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p>
227    /// <p>Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p>
228    /// <p>Constraints: Minimum 30-minute window.</p>
229    pub fn get_preferred_maintenance_window(&self) -> &::std::option::Option<::std::string::String> {
230        self.inner.get_preferred_maintenance_window()
231    }
232    /// <p>This parameter does not apply to Amazon DocumentDB. Amazon DocumentDB does not perform minor version upgrades regardless of the value set.</p>
233    /// <p>Default: <code>false</code></p>
234    pub fn auto_minor_version_upgrade(mut self, input: bool) -> Self {
235        self.inner = self.inner.auto_minor_version_upgrade(input);
236        self
237    }
238    /// <p>This parameter does not apply to Amazon DocumentDB. Amazon DocumentDB does not perform minor version upgrades regardless of the value set.</p>
239    /// <p>Default: <code>false</code></p>
240    pub fn set_auto_minor_version_upgrade(mut self, input: ::std::option::Option<bool>) -> Self {
241        self.inner = self.inner.set_auto_minor_version_upgrade(input);
242        self
243    }
244    /// <p>This parameter does not apply to Amazon DocumentDB. Amazon DocumentDB does not perform minor version upgrades regardless of the value set.</p>
245    /// <p>Default: <code>false</code></p>
246    pub fn get_auto_minor_version_upgrade(&self) -> &::std::option::Option<bool> {
247        self.inner.get_auto_minor_version_upgrade()
248    }
249    ///
250    /// Appends an item to `Tags`.
251    ///
252    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
253    ///
254    /// <p>The tags to be assigned to the instance. You can assign up to 10 tags to an instance.</p>
255    pub fn tags(mut self, input: crate::types::Tag) -> Self {
256        self.inner = self.inner.tags(input);
257        self
258    }
259    /// <p>The tags to be assigned to the instance. You can assign up to 10 tags to an instance.</p>
260    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
261        self.inner = self.inner.set_tags(input);
262        self
263    }
264    /// <p>The tags to be assigned to the instance. You can assign up to 10 tags to an instance.</p>
265    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
266        self.inner.get_tags()
267    }
268    /// <p>The identifier of the cluster that the instance will belong to.</p>
269    pub fn db_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
270        self.inner = self.inner.db_cluster_identifier(input.into());
271        self
272    }
273    /// <p>The identifier of the cluster that the instance will belong to.</p>
274    pub fn set_db_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275        self.inner = self.inner.set_db_cluster_identifier(input);
276        self
277    }
278    /// <p>The identifier of the cluster that the instance will belong to.</p>
279    pub fn get_db_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
280        self.inner.get_db_cluster_identifier()
281    }
282    /// <p>A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.</p>
283    pub fn copy_tags_to_snapshot(mut self, input: bool) -> Self {
284        self.inner = self.inner.copy_tags_to_snapshot(input);
285        self
286    }
287    /// <p>A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.</p>
288    pub fn set_copy_tags_to_snapshot(mut self, input: ::std::option::Option<bool>) -> Self {
289        self.inner = self.inner.set_copy_tags_to_snapshot(input);
290        self
291    }
292    /// <p>A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.</p>
293    pub fn get_copy_tags_to_snapshot(&self) -> &::std::option::Option<bool> {
294        self.inner.get_copy_tags_to_snapshot()
295    }
296    /// <p>A value that specifies the order in which an Amazon DocumentDB replica is promoted to the primary instance after a failure of the existing primary instance.</p>
297    /// <p>Default: 1</p>
298    /// <p>Valid values: 0-15</p>
299    pub fn promotion_tier(mut self, input: i32) -> Self {
300        self.inner = self.inner.promotion_tier(input);
301        self
302    }
303    /// <p>A value that specifies the order in which an Amazon DocumentDB replica is promoted to the primary instance after a failure of the existing primary instance.</p>
304    /// <p>Default: 1</p>
305    /// <p>Valid values: 0-15</p>
306    pub fn set_promotion_tier(mut self, input: ::std::option::Option<i32>) -> Self {
307        self.inner = self.inner.set_promotion_tier(input);
308        self
309    }
310    /// <p>A value that specifies the order in which an Amazon DocumentDB replica is promoted to the primary instance after a failure of the existing primary instance.</p>
311    /// <p>Default: 1</p>
312    /// <p>Valid values: 0-15</p>
313    pub fn get_promotion_tier(&self) -> &::std::option::Option<i32> {
314        self.inner.get_promotion_tier()
315    }
316    /// <p>A value that indicates whether to enable Performance Insights for the DB Instance. For more information, see <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/performance-insights.html">Using Amazon Performance Insights</a>.</p>
317    pub fn enable_performance_insights(mut self, input: bool) -> Self {
318        self.inner = self.inner.enable_performance_insights(input);
319        self
320    }
321    /// <p>A value that indicates whether to enable Performance Insights for the DB Instance. For more information, see <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/performance-insights.html">Using Amazon Performance Insights</a>.</p>
322    pub fn set_enable_performance_insights(mut self, input: ::std::option::Option<bool>) -> Self {
323        self.inner = self.inner.set_enable_performance_insights(input);
324        self
325    }
326    /// <p>A value that indicates whether to enable Performance Insights for the DB Instance. For more information, see <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/performance-insights.html">Using Amazon Performance Insights</a>.</p>
327    pub fn get_enable_performance_insights(&self) -> &::std::option::Option<bool> {
328        self.inner.get_enable_performance_insights()
329    }
330    /// <p>The KMS key identifier for encryption of Performance Insights data.</p>
331    /// <p>The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.</p>
332    /// <p>If you do not specify a value for PerformanceInsightsKMSKeyId, then Amazon DocumentDB uses your default KMS key. There is a default KMS key for your Amazon Web Services account. Your Amazon Web Services account has a different default KMS key for each Amazon Web Services region.</p>
333    pub fn performance_insights_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
334        self.inner = self.inner.performance_insights_kms_key_id(input.into());
335        self
336    }
337    /// <p>The KMS key identifier for encryption of Performance Insights data.</p>
338    /// <p>The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.</p>
339    /// <p>If you do not specify a value for PerformanceInsightsKMSKeyId, then Amazon DocumentDB uses your default KMS key. There is a default KMS key for your Amazon Web Services account. Your Amazon Web Services account has a different default KMS key for each Amazon Web Services region.</p>
340    pub fn set_performance_insights_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
341        self.inner = self.inner.set_performance_insights_kms_key_id(input);
342        self
343    }
344    /// <p>The KMS key identifier for encryption of Performance Insights data.</p>
345    /// <p>The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.</p>
346    /// <p>If you do not specify a value for PerformanceInsightsKMSKeyId, then Amazon DocumentDB uses your default KMS key. There is a default KMS key for your Amazon Web Services account. Your Amazon Web Services account has a different default KMS key for each Amazon Web Services region.</p>
347    pub fn get_performance_insights_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
348        self.inner.get_performance_insights_kms_key_id()
349    }
350    /// <p>The CA certificate identifier to use for the DB instance's server certificate.</p>
351    /// <p>For more information, see <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/ca_cert_rotation.html">Updating Your Amazon DocumentDB TLS Certificates</a> and <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/security.encryption.ssl.html"> Encrypting Data in Transit</a> in the <i>Amazon DocumentDB Developer Guide</i>.</p>
352    pub fn ca_certificate_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
353        self.inner = self.inner.ca_certificate_identifier(input.into());
354        self
355    }
356    /// <p>The CA certificate identifier to use for the DB instance's server certificate.</p>
357    /// <p>For more information, see <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/ca_cert_rotation.html">Updating Your Amazon DocumentDB TLS Certificates</a> and <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/security.encryption.ssl.html"> Encrypting Data in Transit</a> in the <i>Amazon DocumentDB Developer Guide</i>.</p>
358    pub fn set_ca_certificate_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
359        self.inner = self.inner.set_ca_certificate_identifier(input);
360        self
361    }
362    /// <p>The CA certificate identifier to use for the DB instance's server certificate.</p>
363    /// <p>For more information, see <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/ca_cert_rotation.html">Updating Your Amazon DocumentDB TLS Certificates</a> and <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/security.encryption.ssl.html"> Encrypting Data in Transit</a> in the <i>Amazon DocumentDB Developer Guide</i>.</p>
364    pub fn get_ca_certificate_identifier(&self) -> &::std::option::Option<::std::string::String> {
365        self.inner.get_ca_certificate_identifier()
366    }
367}