aws_sdk_redshift/client/
get_cluster_credentials.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`GetClusterCredentials`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`db_user(impl Into<String>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::db_user) / [`set_db_user(Option<String>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::set_db_user):<br>required: **true**<br><p>The name of a database user. If a user name matching <code>DbUser</code> exists in the database, the temporary user credentials have the same permissions as the existing user. If <code>DbUser</code> doesn't exist in the database and <code>Autocreate</code> is <code>True</code>, a new user is created using the value for <code>DbUser</code> with PUBLIC permissions. If a database user matching the value for <code>DbUser</code> doesn't exist and <code>Autocreate</code> is <code>False</code>, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_USER.html">CREATE USER</a> in the Amazon Redshift Database Developer Guide.</p> <p>Constraints:</p> <ul>  <li>   <p>Must be 1 to 64 alphanumeric characters or hyphens. The user name can't be <code>PUBLIC</code>.</p></li>  <li>   <p>Must contain uppercase or lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.</p></li>  <li>   <p>First character must be a letter.</p></li>  <li>   <p>Must not contain a colon ( : ) or slash ( / ).</p></li>  <li>   <p>Cannot be a reserved word. A list of reserved words can be found in <a href="http://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html">Reserved Words</a> in the Amazon Redshift Database Developer Guide.</p></li> </ul><br>
7    ///   - [`db_name(impl Into<String>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::db_name) / [`set_db_name(Option<String>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::set_db_name):<br>required: **false**<br><p>The name of a database that <code>DbUser</code> is authorized to log on to. If <code>DbName</code> is not specified, <code>DbUser</code> can log on to any existing database.</p> <p>Constraints:</p> <ul>  <li>   <p>Must be 1 to 64 alphanumeric characters or hyphens</p></li>  <li>   <p>Must contain uppercase or lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.</p></li>  <li>   <p>First character must be a letter.</p></li>  <li>   <p>Must not contain a colon ( : ) or slash ( / ).</p></li>  <li>   <p>Cannot be a reserved word. A list of reserved words can be found in <a href="http://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html">Reserved Words</a> in the Amazon Redshift Database Developer Guide.</p></li> </ul><br>
8    ///   - [`cluster_identifier(impl Into<String>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::cluster_identifier) / [`set_cluster_identifier(Option<String>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::set_cluster_identifier):<br>required: **false**<br><p>The unique identifier of the cluster that contains the database for which you are requesting credentials. This parameter is case sensitive.</p><br>
9    ///   - [`duration_seconds(i32)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::duration_seconds) / [`set_duration_seconds(Option<i32>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::set_duration_seconds):<br>required: **false**<br><p>The number of seconds until the returned temporary password expires.</p> <p>Constraint: minimum 900, maximum 3600.</p> <p>Default: 900</p><br>
10    ///   - [`auto_create(bool)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::auto_create) / [`set_auto_create(Option<bool>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::set_auto_create):<br>required: **false**<br><p>Create a database user with the name specified for the user named in <code>DbUser</code> if one does not exist.</p><br>
11    ///   - [`db_groups(impl Into<String>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::db_groups) / [`set_db_groups(Option<Vec::<String>>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::set_db_groups):<br>required: **false**<br><p>A list of the names of existing database groups that the user named in <code>DbUser</code> will join for the current session, in addition to any group memberships for an existing user. If not specified, a new user is added only to PUBLIC.</p> <p>Database group name constraints</p> <ul>  <li>   <p>Must be 1 to 64 alphanumeric characters or hyphens</p></li>  <li>   <p>Must contain only lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.</p></li>  <li>   <p>First character must be a letter.</p></li>  <li>   <p>Must not contain a colon ( : ) or slash ( / ).</p></li>  <li>   <p>Cannot be a reserved word. A list of reserved words can be found in <a href="http://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html">Reserved Words</a> in the Amazon Redshift Database Developer Guide.</p></li> </ul><br>
12    ///   - [`custom_domain_name(impl Into<String>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::custom_domain_name) / [`set_custom_domain_name(Option<String>)`](crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::set_custom_domain_name):<br>required: **false**<br><p>The custom domain name for the cluster credentials.</p><br>
13    /// - On success, responds with [`GetClusterCredentialsOutput`](crate::operation::get_cluster_credentials::GetClusterCredentialsOutput) with field(s):
14    ///   - [`db_user(Option<String>)`](crate::operation::get_cluster_credentials::GetClusterCredentialsOutput::db_user): <p>A database user name that is authorized to log on to the database <code>DbName</code> using the password <code>DbPassword</code>. If the specified DbUser exists in the database, the new user name has the same database permissions as the the user named in DbUser. By default, the user is added to PUBLIC. If the <code>DbGroups</code> parameter is specifed, <code>DbUser</code> is added to the listed groups for any sessions created using these credentials.</p>
15    ///   - [`db_password(Option<String>)`](crate::operation::get_cluster_credentials::GetClusterCredentialsOutput::db_password): <p>A temporary password that authorizes the user name returned by <code>DbUser</code> to log on to the database <code>DbName</code>.</p>
16    ///   - [`expiration(Option<DateTime>)`](crate::operation::get_cluster_credentials::GetClusterCredentialsOutput::expiration): <p>The date and time the password in <code>DbPassword</code> expires.</p>
17    /// - On failure, responds with [`SdkError<GetClusterCredentialsError>`](crate::operation::get_cluster_credentials::GetClusterCredentialsError)
18    pub fn get_cluster_credentials(&self) -> crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder {
19        crate::operation::get_cluster_credentials::builders::GetClusterCredentialsFluentBuilder::new(self.handle.clone())
20    }
21}