AWS v6.55.0 published on Monday, Oct 7, 2024 by Pulumi
aws.redshift.getClusterCredentials
Explore with Pulumi AI
Provides redshift cluster temporary credentials.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.redshift.getClusterCredentials({
clusterIdentifier: exampleAwsRedshiftCluster.clusterIdentifier,
dbUser: exampleAwsRedshiftCluster.masterUsername,
});
import pulumi
import pulumi_aws as aws
example = aws.redshift.get_cluster_credentials(cluster_identifier=example_aws_redshift_cluster["clusterIdentifier"],
db_user=example_aws_redshift_cluster["masterUsername"])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshift"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := redshift.GetClusterCredentials(ctx, &redshift.GetClusterCredentialsArgs{
ClusterIdentifier: exampleAwsRedshiftCluster.ClusterIdentifier,
DbUser: exampleAwsRedshiftCluster.MasterUsername,
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.RedShift.GetClusterCredentials.Invoke(new()
{
ClusterIdentifier = exampleAwsRedshiftCluster.ClusterIdentifier,
DbUser = exampleAwsRedshiftCluster.MasterUsername,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.redshift.RedshiftFunctions;
import com.pulumi.aws.redshift.inputs.GetClusterCredentialsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = RedshiftFunctions.getClusterCredentials(GetClusterCredentialsArgs.builder()
.clusterIdentifier(exampleAwsRedshiftCluster.clusterIdentifier())
.dbUser(exampleAwsRedshiftCluster.masterUsername())
.build());
}
}
variables:
example:
fn::invoke:
Function: aws:redshift:getClusterCredentials
Arguments:
clusterIdentifier: ${exampleAwsRedshiftCluster.clusterIdentifier}
dbUser: ${exampleAwsRedshiftCluster.masterUsername}
Using getClusterCredentials
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getClusterCredentials(args: GetClusterCredentialsArgs, opts?: InvokeOptions): Promise<GetClusterCredentialsResult>
function getClusterCredentialsOutput(args: GetClusterCredentialsOutputArgs, opts?: InvokeOptions): Output<GetClusterCredentialsResult>
def get_cluster_credentials(auto_create: Optional[bool] = None,
cluster_identifier: Optional[str] = None,
db_groups: Optional[Sequence[str]] = None,
db_name: Optional[str] = None,
db_user: Optional[str] = None,
duration_seconds: Optional[int] = None,
opts: Optional[InvokeOptions] = None) -> GetClusterCredentialsResult
def get_cluster_credentials_output(auto_create: Optional[pulumi.Input[bool]] = None,
cluster_identifier: Optional[pulumi.Input[str]] = None,
db_groups: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
db_name: Optional[pulumi.Input[str]] = None,
db_user: Optional[pulumi.Input[str]] = None,
duration_seconds: Optional[pulumi.Input[int]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetClusterCredentialsResult]
func GetClusterCredentials(ctx *Context, args *GetClusterCredentialsArgs, opts ...InvokeOption) (*GetClusterCredentialsResult, error)
func GetClusterCredentialsOutput(ctx *Context, args *GetClusterCredentialsOutputArgs, opts ...InvokeOption) GetClusterCredentialsResultOutput
> Note: This function is named GetClusterCredentials
in the Go SDK.
public static class GetClusterCredentials
{
public static Task<GetClusterCredentialsResult> InvokeAsync(GetClusterCredentialsArgs args, InvokeOptions? opts = null)
public static Output<GetClusterCredentialsResult> Invoke(GetClusterCredentialsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetClusterCredentialsResult> getClusterCredentials(GetClusterCredentialsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:redshift/getClusterCredentials:getClusterCredentials
arguments:
# arguments dictionary
The following arguments are supported:
- Cluster
Identifier string - Unique identifier of the cluster that contains the database for which your are requesting credentials.
- Db
User string - Name of a database user. If a user name matching
db_user
exists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_user
doesn't exist in the database andauto_create
isTrue
, a new user is created using the value fordb_user
withPUBLIC
permissions. If a database user matching the value fordb_user
doesn't exist andnot
isFalse
, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database. - Auto
Create bool - Create a database user with the name specified for the user named in
db_user
if one does not exist. - Db
Groups List<string> - List of the names of existing database groups that the user named in
db_user
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 toPUBLIC
. - Db
Name string - Name of a database that DbUser is authorized to log on to. If
db_name
is not specified,db_user
can log on to any existing database. - Duration
Seconds int - The number of seconds until the returned temporary password expires. Valid values are between
900
and3600
. Default value is900
.
- Cluster
Identifier string - Unique identifier of the cluster that contains the database for which your are requesting credentials.
- Db
User string - Name of a database user. If a user name matching
db_user
exists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_user
doesn't exist in the database andauto_create
isTrue
, a new user is created using the value fordb_user
withPUBLIC
permissions. If a database user matching the value fordb_user
doesn't exist andnot
isFalse
, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database. - Auto
Create bool - Create a database user with the name specified for the user named in
db_user
if one does not exist. - Db
Groups []string - List of the names of existing database groups that the user named in
db_user
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 toPUBLIC
. - Db
Name string - Name of a database that DbUser is authorized to log on to. If
db_name
is not specified,db_user
can log on to any existing database. - Duration
Seconds int - The number of seconds until the returned temporary password expires. Valid values are between
900
and3600
. Default value is900
.
- cluster
Identifier String - Unique identifier of the cluster that contains the database for which your are requesting credentials.
- db
User String - Name of a database user. If a user name matching
db_user
exists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_user
doesn't exist in the database andauto_create
isTrue
, a new user is created using the value fordb_user
withPUBLIC
permissions. If a database user matching the value fordb_user
doesn't exist andnot
isFalse
, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database. - auto
Create Boolean - Create a database user with the name specified for the user named in
db_user
if one does not exist. - db
Groups List<String> - List of the names of existing database groups that the user named in
db_user
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 toPUBLIC
. - db
Name String - Name of a database that DbUser is authorized to log on to. If
db_name
is not specified,db_user
can log on to any existing database. - duration
Seconds Integer - The number of seconds until the returned temporary password expires. Valid values are between
900
and3600
. Default value is900
.
- cluster
Identifier string - Unique identifier of the cluster that contains the database for which your are requesting credentials.
- db
User string - Name of a database user. If a user name matching
db_user
exists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_user
doesn't exist in the database andauto_create
isTrue
, a new user is created using the value fordb_user
withPUBLIC
permissions. If a database user matching the value fordb_user
doesn't exist andnot
isFalse
, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database. - auto
Create boolean - Create a database user with the name specified for the user named in
db_user
if one does not exist. - db
Groups string[] - List of the names of existing database groups that the user named in
db_user
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 toPUBLIC
. - db
Name string - Name of a database that DbUser is authorized to log on to. If
db_name
is not specified,db_user
can log on to any existing database. - duration
Seconds number - The number of seconds until the returned temporary password expires. Valid values are between
900
and3600
. Default value is900
.
- cluster_
identifier str - Unique identifier of the cluster that contains the database for which your are requesting credentials.
- db_
user str - Name of a database user. If a user name matching
db_user
exists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_user
doesn't exist in the database andauto_create
isTrue
, a new user is created using the value fordb_user
withPUBLIC
permissions. If a database user matching the value fordb_user
doesn't exist andnot
isFalse
, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database. - auto_
create bool - Create a database user with the name specified for the user named in
db_user
if one does not exist. - db_
groups Sequence[str] - List of the names of existing database groups that the user named in
db_user
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 toPUBLIC
. - db_
name str - Name of a database that DbUser is authorized to log on to. If
db_name
is not specified,db_user
can log on to any existing database. - duration_
seconds int - The number of seconds until the returned temporary password expires. Valid values are between
900
and3600
. Default value is900
.
- cluster
Identifier String - Unique identifier of the cluster that contains the database for which your are requesting credentials.
- db
User String - Name of a database user. If a user name matching
db_user
exists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_user
doesn't exist in the database andauto_create
isTrue
, a new user is created using the value fordb_user
withPUBLIC
permissions. If a database user matching the value fordb_user
doesn't exist andnot
isFalse
, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database. - auto
Create Boolean - Create a database user with the name specified for the user named in
db_user
if one does not exist. - db
Groups List<String> - List of the names of existing database groups that the user named in
db_user
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 toPUBLIC
. - db
Name String - Name of a database that DbUser is authorized to log on to. If
db_name
is not specified,db_user
can log on to any existing database. - duration
Seconds Number - The number of seconds until the returned temporary password expires. Valid values are between
900
and3600
. Default value is900
.
getClusterCredentials Result
The following output properties are available:
- Cluster
Identifier string - Db
Password string - Temporary password that authorizes the user name returned by
db_user
to log on to the databasedb_name
. - Db
User string - Expiration string
- Date and time the password in
db_password
expires. - Id string
- The provider-assigned unique ID for this managed resource.
- Auto
Create bool - Db
Groups List<string> - Db
Name string - Duration
Seconds int
- Cluster
Identifier string - Db
Password string - Temporary password that authorizes the user name returned by
db_user
to log on to the databasedb_name
. - Db
User string - Expiration string
- Date and time the password in
db_password
expires. - Id string
- The provider-assigned unique ID for this managed resource.
- Auto
Create bool - Db
Groups []string - Db
Name string - Duration
Seconds int
- cluster
Identifier String - db
Password String - Temporary password that authorizes the user name returned by
db_user
to log on to the databasedb_name
. - db
User String - expiration String
- Date and time the password in
db_password
expires. - id String
- The provider-assigned unique ID for this managed resource.
- auto
Create Boolean - db
Groups List<String> - db
Name String - duration
Seconds Integer
- cluster
Identifier string - db
Password string - Temporary password that authorizes the user name returned by
db_user
to log on to the databasedb_name
. - db
User string - expiration string
- Date and time the password in
db_password
expires. - id string
- The provider-assigned unique ID for this managed resource.
- auto
Create boolean - db
Groups string[] - db
Name string - duration
Seconds number
- cluster_
identifier str - db_
password str - Temporary password that authorizes the user name returned by
db_user
to log on to the databasedb_name
. - db_
user str - expiration str
- Date and time the password in
db_password
expires. - id str
- The provider-assigned unique ID for this managed resource.
- auto_
create bool - db_
groups Sequence[str] - db_
name str - duration_
seconds int
- cluster
Identifier String - db
Password String - Temporary password that authorizes the user name returned by
db_user
to log on to the databasedb_name
. - db
User String - expiration String
- Date and time the password in
db_password
expires. - id String
- The provider-assigned unique ID for this managed resource.
- auto
Create Boolean - db
Groups List<String> - db
Name String - duration
Seconds Number
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.