aws_sdk_rds/operation/create_db_proxy/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_db_proxy::_create_db_proxy_output::CreateDbProxyOutputBuilder;
3
4pub use crate::operation::create_db_proxy::_create_db_proxy_input::CreateDbProxyInputBuilder;
5
6impl crate::operation::create_db_proxy::builders::CreateDbProxyInputBuilder {
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_proxy::CreateDbProxyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_db_proxy::CreateDBProxyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_db_proxy();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDBProxy`.
24///
25/// <p>Creates a new DB proxy.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateDBProxyFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_db_proxy::builders::CreateDbProxyInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_db_proxy::CreateDbProxyOutput,
35        crate::operation::create_db_proxy::CreateDBProxyError,
36    > for CreateDBProxyFluentBuilder
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_proxy::CreateDbProxyOutput,
44            crate::operation::create_db_proxy::CreateDBProxyError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateDBProxyFluentBuilder {
51    /// Creates a new `CreateDBProxyFluentBuilder`.
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 CreateDBProxy as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_db_proxy::builders::CreateDbProxyInputBuilder {
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_proxy::CreateDbProxyOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_db_proxy::CreateDBProxyError,
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_proxy::CreateDBProxy::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_db_proxy::CreateDBProxy::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_proxy::CreateDbProxyOutput,
97        crate::operation::create_db_proxy::CreateDBProxyError,
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 identifier for the proxy. This name must be unique for all proxies owned by your Amazon Web Services account in the specified Amazon Web Services Region. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive hyphens.</p>
112    pub fn db_proxy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.db_proxy_name(input.into());
114        self
115    }
116    /// <p>The identifier for the proxy. This name must be unique for all proxies owned by your Amazon Web Services account in the specified Amazon Web Services Region. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive hyphens.</p>
117    pub fn set_db_proxy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_db_proxy_name(input);
119        self
120    }
121    /// <p>The identifier for the proxy. This name must be unique for all proxies owned by your Amazon Web Services account in the specified Amazon Web Services Region. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive hyphens.</p>
122    pub fn get_db_proxy_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_db_proxy_name()
124    }
125    /// <p>The kinds of databases that the proxy can connect to. This value determines which database network protocol the proxy recognizes when it interprets network traffic to and from the database. For Aurora MySQL, RDS for MariaDB, and RDS for MySQL databases, specify <code>MYSQL</code>. For Aurora PostgreSQL and RDS for PostgreSQL databases, specify <code>POSTGRESQL</code>. For RDS for Microsoft SQL Server, specify <code>SQLSERVER</code>.</p>
126    pub fn engine_family(mut self, input: crate::types::EngineFamily) -> Self {
127        self.inner = self.inner.engine_family(input);
128        self
129    }
130    /// <p>The kinds of databases that the proxy can connect to. This value determines which database network protocol the proxy recognizes when it interprets network traffic to and from the database. For Aurora MySQL, RDS for MariaDB, and RDS for MySQL databases, specify <code>MYSQL</code>. For Aurora PostgreSQL and RDS for PostgreSQL databases, specify <code>POSTGRESQL</code>. For RDS for Microsoft SQL Server, specify <code>SQLSERVER</code>.</p>
131    pub fn set_engine_family(mut self, input: ::std::option::Option<crate::types::EngineFamily>) -> Self {
132        self.inner = self.inner.set_engine_family(input);
133        self
134    }
135    /// <p>The kinds of databases that the proxy can connect to. This value determines which database network protocol the proxy recognizes when it interprets network traffic to and from the database. For Aurora MySQL, RDS for MariaDB, and RDS for MySQL databases, specify <code>MYSQL</code>. For Aurora PostgreSQL and RDS for PostgreSQL databases, specify <code>POSTGRESQL</code>. For RDS for Microsoft SQL Server, specify <code>SQLSERVER</code>.</p>
136    pub fn get_engine_family(&self) -> &::std::option::Option<crate::types::EngineFamily> {
137        self.inner.get_engine_family()
138    }
139    /// <p>The default authentication scheme that the proxy uses for client connections to the proxy and connections from the proxy to the underlying database. Valid values are <code>NONE</code> and <code>IAM_AUTH</code>. When set to <code>IAM_AUTH</code>, the proxy uses end-to-end IAM authentication to connect to the database. If you don't specify <code>DefaultAuthScheme</code> or specify this parameter as <code>NONE</code>, you must specify the <code>Auth</code> option.</p>
140    pub fn default_auth_scheme(mut self, input: crate::types::DefaultAuthScheme) -> Self {
141        self.inner = self.inner.default_auth_scheme(input);
142        self
143    }
144    /// <p>The default authentication scheme that the proxy uses for client connections to the proxy and connections from the proxy to the underlying database. Valid values are <code>NONE</code> and <code>IAM_AUTH</code>. When set to <code>IAM_AUTH</code>, the proxy uses end-to-end IAM authentication to connect to the database. If you don't specify <code>DefaultAuthScheme</code> or specify this parameter as <code>NONE</code>, you must specify the <code>Auth</code> option.</p>
145    pub fn set_default_auth_scheme(mut self, input: ::std::option::Option<crate::types::DefaultAuthScheme>) -> Self {
146        self.inner = self.inner.set_default_auth_scheme(input);
147        self
148    }
149    /// <p>The default authentication scheme that the proxy uses for client connections to the proxy and connections from the proxy to the underlying database. Valid values are <code>NONE</code> and <code>IAM_AUTH</code>. When set to <code>IAM_AUTH</code>, the proxy uses end-to-end IAM authentication to connect to the database. If you don't specify <code>DefaultAuthScheme</code> or specify this parameter as <code>NONE</code>, you must specify the <code>Auth</code> option.</p>
150    pub fn get_default_auth_scheme(&self) -> &::std::option::Option<crate::types::DefaultAuthScheme> {
151        self.inner.get_default_auth_scheme()
152    }
153    ///
154    /// Appends an item to `Auth`.
155    ///
156    /// To override the contents of this collection use [`set_auth`](Self::set_auth).
157    ///
158    /// <p>The authorization mechanism that the proxy uses.</p>
159    pub fn auth(mut self, input: crate::types::UserAuthConfig) -> Self {
160        self.inner = self.inner.auth(input);
161        self
162    }
163    /// <p>The authorization mechanism that the proxy uses.</p>
164    pub fn set_auth(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UserAuthConfig>>) -> Self {
165        self.inner = self.inner.set_auth(input);
166        self
167    }
168    /// <p>The authorization mechanism that the proxy uses.</p>
169    pub fn get_auth(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UserAuthConfig>> {
170        self.inner.get_auth()
171    }
172    /// <p>The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access secrets in Amazon Web Services Secrets Manager.</p>
173    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.inner = self.inner.role_arn(input.into());
175        self
176    }
177    /// <p>The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access secrets in Amazon Web Services Secrets Manager.</p>
178    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.inner = self.inner.set_role_arn(input);
180        self
181    }
182    /// <p>The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access secrets in Amazon Web Services Secrets Manager.</p>
183    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
184        self.inner.get_role_arn()
185    }
186    ///
187    /// Appends an item to `VpcSubnetIds`.
188    ///
189    /// To override the contents of this collection use [`set_vpc_subnet_ids`](Self::set_vpc_subnet_ids).
190    ///
191    /// <p>One or more VPC subnet IDs to associate with the new proxy.</p>
192    pub fn vpc_subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.inner = self.inner.vpc_subnet_ids(input.into());
194        self
195    }
196    /// <p>One or more VPC subnet IDs to associate with the new proxy.</p>
197    pub fn set_vpc_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
198        self.inner = self.inner.set_vpc_subnet_ids(input);
199        self
200    }
201    /// <p>One or more VPC subnet IDs to associate with the new proxy.</p>
202    pub fn get_vpc_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
203        self.inner.get_vpc_subnet_ids()
204    }
205    ///
206    /// Appends an item to `VpcSecurityGroupIds`.
207    ///
208    /// To override the contents of this collection use [`set_vpc_security_group_ids`](Self::set_vpc_security_group_ids).
209    ///
210    /// <p>One or more VPC security group IDs to associate with the new proxy.</p>
211    pub fn vpc_security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.inner = self.inner.vpc_security_group_ids(input.into());
213        self
214    }
215    /// <p>One or more VPC security group IDs to associate with the new proxy.</p>
216    pub fn set_vpc_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
217        self.inner = self.inner.set_vpc_security_group_ids(input);
218        self
219    }
220    /// <p>One or more VPC security group IDs to associate with the new proxy.</p>
221    pub fn get_vpc_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
222        self.inner.get_vpc_security_group_ids()
223    }
224    /// <p>Specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy. By enabling this setting, you can enforce encrypted TLS connections to the proxy.</p>
225    pub fn require_tls(mut self, input: bool) -> Self {
226        self.inner = self.inner.require_tls(input);
227        self
228    }
229    /// <p>Specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy. By enabling this setting, you can enforce encrypted TLS connections to the proxy.</p>
230    pub fn set_require_tls(mut self, input: ::std::option::Option<bool>) -> Self {
231        self.inner = self.inner.set_require_tls(input);
232        self
233    }
234    /// <p>Specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy. By enabling this setting, you can enforce encrypted TLS connections to the proxy.</p>
235    pub fn get_require_tls(&self) -> &::std::option::Option<bool> {
236        self.inner.get_require_tls()
237    }
238    /// <p>The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it. You can set this value higher or lower than the connection timeout limit for the associated database.</p>
239    pub fn idle_client_timeout(mut self, input: i32) -> Self {
240        self.inner = self.inner.idle_client_timeout(input);
241        self
242    }
243    /// <p>The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it. You can set this value higher or lower than the connection timeout limit for the associated database.</p>
244    pub fn set_idle_client_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
245        self.inner = self.inner.set_idle_client_timeout(input);
246        self
247    }
248    /// <p>The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it. You can set this value higher or lower than the connection timeout limit for the associated database.</p>
249    pub fn get_idle_client_timeout(&self) -> &::std::option::Option<i32> {
250        self.inner.get_idle_client_timeout()
251    }
252    /// <p>Specifies whether the proxy logs detailed connection and query information. When you enable <code>DebugLogging</code>, the proxy captures connection details and connection pool behavior from your queries. Debug logging increases CloudWatch costs and can impact proxy performance. Enable this option only when you need to troubleshoot connection or performance issues.</p>
253    pub fn debug_logging(mut self, input: bool) -> Self {
254        self.inner = self.inner.debug_logging(input);
255        self
256    }
257    /// <p>Specifies whether the proxy logs detailed connection and query information. When you enable <code>DebugLogging</code>, the proxy captures connection details and connection pool behavior from your queries. Debug logging increases CloudWatch costs and can impact proxy performance. Enable this option only when you need to troubleshoot connection or performance issues.</p>
258    pub fn set_debug_logging(mut self, input: ::std::option::Option<bool>) -> Self {
259        self.inner = self.inner.set_debug_logging(input);
260        self
261    }
262    /// <p>Specifies whether the proxy logs detailed connection and query information. When you enable <code>DebugLogging</code>, the proxy captures connection details and connection pool behavior from your queries. Debug logging increases CloudWatch costs and can impact proxy performance. Enable this option only when you need to troubleshoot connection or performance issues.</p>
263    pub fn get_debug_logging(&self) -> &::std::option::Option<bool> {
264        self.inner.get_debug_logging()
265    }
266    ///
267    /// Appends an item to `Tags`.
268    ///
269    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
270    ///
271    /// <p>An optional set of key-value pairs to associate arbitrary data of your choosing with the proxy.</p>
272    pub fn tags(mut self, input: crate::types::Tag) -> Self {
273        self.inner = self.inner.tags(input);
274        self
275    }
276    /// <p>An optional set of key-value pairs to associate arbitrary data of your choosing with the proxy.</p>
277    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
278        self.inner = self.inner.set_tags(input);
279        self
280    }
281    /// <p>An optional set of key-value pairs to associate arbitrary data of your choosing with the proxy.</p>
282    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
283        self.inner.get_tags()
284    }
285    /// <p>The network type of the DB proxy endpoint. The network type determines the IP version that the proxy endpoint supports.</p>
286    /// <p>Valid values:</p>
287    /// <ul>
288    /// <li>
289    /// <p><code>IPV4</code> - The proxy endpoint supports IPv4 only.</p></li>
290    /// <li>
291    /// <p><code>IPV6</code> - The proxy endpoint supports IPv6 only.</p></li>
292    /// <li>
293    /// <p><code>DUAL</code> - The proxy endpoint supports both IPv4 and IPv6.</p></li>
294    /// </ul>
295    /// <p>Default: <code>IPV4</code></p>
296    /// <p>Constraints:</p>
297    /// <ul>
298    /// <li>
299    /// <p>If you specify <code>IPV6</code> or <code>DUAL</code>, the VPC and all subnets must have an IPv6 CIDR block.</p></li>
300    /// <li>
301    /// <p>If you specify <code>IPV6</code> or <code>DUAL</code>, the VPC tenancy cannot be <code>dedicated</code>.</p></li>
302    /// </ul>
303    pub fn endpoint_network_type(mut self, input: crate::types::EndpointNetworkType) -> Self {
304        self.inner = self.inner.endpoint_network_type(input);
305        self
306    }
307    /// <p>The network type of the DB proxy endpoint. The network type determines the IP version that the proxy endpoint supports.</p>
308    /// <p>Valid values:</p>
309    /// <ul>
310    /// <li>
311    /// <p><code>IPV4</code> - The proxy endpoint supports IPv4 only.</p></li>
312    /// <li>
313    /// <p><code>IPV6</code> - The proxy endpoint supports IPv6 only.</p></li>
314    /// <li>
315    /// <p><code>DUAL</code> - The proxy endpoint supports both IPv4 and IPv6.</p></li>
316    /// </ul>
317    /// <p>Default: <code>IPV4</code></p>
318    /// <p>Constraints:</p>
319    /// <ul>
320    /// <li>
321    /// <p>If you specify <code>IPV6</code> or <code>DUAL</code>, the VPC and all subnets must have an IPv6 CIDR block.</p></li>
322    /// <li>
323    /// <p>If you specify <code>IPV6</code> or <code>DUAL</code>, the VPC tenancy cannot be <code>dedicated</code>.</p></li>
324    /// </ul>
325    pub fn set_endpoint_network_type(mut self, input: ::std::option::Option<crate::types::EndpointNetworkType>) -> Self {
326        self.inner = self.inner.set_endpoint_network_type(input);
327        self
328    }
329    /// <p>The network type of the DB proxy endpoint. The network type determines the IP version that the proxy endpoint supports.</p>
330    /// <p>Valid values:</p>
331    /// <ul>
332    /// <li>
333    /// <p><code>IPV4</code> - The proxy endpoint supports IPv4 only.</p></li>
334    /// <li>
335    /// <p><code>IPV6</code> - The proxy endpoint supports IPv6 only.</p></li>
336    /// <li>
337    /// <p><code>DUAL</code> - The proxy endpoint supports both IPv4 and IPv6.</p></li>
338    /// </ul>
339    /// <p>Default: <code>IPV4</code></p>
340    /// <p>Constraints:</p>
341    /// <ul>
342    /// <li>
343    /// <p>If you specify <code>IPV6</code> or <code>DUAL</code>, the VPC and all subnets must have an IPv6 CIDR block.</p></li>
344    /// <li>
345    /// <p>If you specify <code>IPV6</code> or <code>DUAL</code>, the VPC tenancy cannot be <code>dedicated</code>.</p></li>
346    /// </ul>
347    pub fn get_endpoint_network_type(&self) -> &::std::option::Option<crate::types::EndpointNetworkType> {
348        self.inner.get_endpoint_network_type()
349    }
350    /// <p>The network type that the proxy uses to connect to the target database. The network type determines the IP version that the proxy uses for connections to the database.</p>
351    /// <p>Valid values:</p>
352    /// <ul>
353    /// <li>
354    /// <p><code>IPV4</code> - The proxy connects to the database using IPv4 only.</p></li>
355    /// <li>
356    /// <p><code>IPV6</code> - The proxy connects to the database using IPv6 only.</p></li>
357    /// </ul>
358    /// <p>Default: <code>IPV4</code></p>
359    /// <p>Constraints:</p>
360    /// <ul>
361    /// <li>
362    /// <p>If you specify <code>IPV6</code>, the database must support dual-stack mode. RDS doesn't support IPv6-only databases.</p></li>
363    /// <li>
364    /// <p>All targets registered with the proxy must be compatible with the specified network type.</p></li>
365    /// </ul>
366    pub fn target_connection_network_type(mut self, input: crate::types::TargetConnectionNetworkType) -> Self {
367        self.inner = self.inner.target_connection_network_type(input);
368        self
369    }
370    /// <p>The network type that the proxy uses to connect to the target database. The network type determines the IP version that the proxy uses for connections to the database.</p>
371    /// <p>Valid values:</p>
372    /// <ul>
373    /// <li>
374    /// <p><code>IPV4</code> - The proxy connects to the database using IPv4 only.</p></li>
375    /// <li>
376    /// <p><code>IPV6</code> - The proxy connects to the database using IPv6 only.</p></li>
377    /// </ul>
378    /// <p>Default: <code>IPV4</code></p>
379    /// <p>Constraints:</p>
380    /// <ul>
381    /// <li>
382    /// <p>If you specify <code>IPV6</code>, the database must support dual-stack mode. RDS doesn't support IPv6-only databases.</p></li>
383    /// <li>
384    /// <p>All targets registered with the proxy must be compatible with the specified network type.</p></li>
385    /// </ul>
386    pub fn set_target_connection_network_type(mut self, input: ::std::option::Option<crate::types::TargetConnectionNetworkType>) -> Self {
387        self.inner = self.inner.set_target_connection_network_type(input);
388        self
389    }
390    /// <p>The network type that the proxy uses to connect to the target database. The network type determines the IP version that the proxy uses for connections to the database.</p>
391    /// <p>Valid values:</p>
392    /// <ul>
393    /// <li>
394    /// <p><code>IPV4</code> - The proxy connects to the database using IPv4 only.</p></li>
395    /// <li>
396    /// <p><code>IPV6</code> - The proxy connects to the database using IPv6 only.</p></li>
397    /// </ul>
398    /// <p>Default: <code>IPV4</code></p>
399    /// <p>Constraints:</p>
400    /// <ul>
401    /// <li>
402    /// <p>If you specify <code>IPV6</code>, the database must support dual-stack mode. RDS doesn't support IPv6-only databases.</p></li>
403    /// <li>
404    /// <p>All targets registered with the proxy must be compatible with the specified network type.</p></li>
405    /// </ul>
406    pub fn get_target_connection_network_type(&self) -> &::std::option::Option<crate::types::TargetConnectionNetworkType> {
407        self.inner.get_target_connection_network_type()
408    }
409}