AWS v6.73.0 published on Wednesday, Mar 19, 2025 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)
public static Output<GetClusterCredentialsResult> getClusterCredentials(GetClusterCredentialsArgs args, InvokeOptions options)
fn::invoke:
  function: aws:redshift/getClusterCredentials:getClusterCredentials
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ClusterIdentifier string
- Unique identifier of the cluster that contains the database for which your are requesting credentials.
- DbUser string
- Name of a database user. If a user name matching db_userexists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_userdoesn't exist in the database andauto_createisTrue, a new user is created using the value fordb_userwithPUBLICpermissions. If a database user matching the value fordb_userdoesn't exist andnotisFalse, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database.
- AutoCreate bool
- Create a database user with the name specified for the user named in db_userif one does not exist.
- DbGroups List<string>
- List of the names of existing database groups that the user named in db_userwill 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.
- DbName string
- Name of a database that DbUser is authorized to log on to. If db_nameis not specified,db_usercan log on to any existing database.
- DurationSeconds int
- The number of seconds until the returned temporary password expires. Valid values are between 900and3600. Default value is900.
- ClusterIdentifier string
- Unique identifier of the cluster that contains the database for which your are requesting credentials.
- DbUser string
- Name of a database user. If a user name matching db_userexists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_userdoesn't exist in the database andauto_createisTrue, a new user is created using the value fordb_userwithPUBLICpermissions. If a database user matching the value fordb_userdoesn't exist andnotisFalse, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database.
- AutoCreate bool
- Create a database user with the name specified for the user named in db_userif one does not exist.
- DbGroups []string
- List of the names of existing database groups that the user named in db_userwill 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.
- DbName string
- Name of a database that DbUser is authorized to log on to. If db_nameis not specified,db_usercan log on to any existing database.
- DurationSeconds int
- The number of seconds until the returned temporary password expires. Valid values are between 900and3600. Default value is900.
- clusterIdentifier String
- Unique identifier of the cluster that contains the database for which your are requesting credentials.
- dbUser String
- Name of a database user. If a user name matching db_userexists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_userdoesn't exist in the database andauto_createisTrue, a new user is created using the value fordb_userwithPUBLICpermissions. If a database user matching the value fordb_userdoesn't exist andnotisFalse, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database.
- autoCreate Boolean
- Create a database user with the name specified for the user named in db_userif one does not exist.
- dbGroups List<String>
- List of the names of existing database groups that the user named in db_userwill 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.
- dbName String
- Name of a database that DbUser is authorized to log on to. If db_nameis not specified,db_usercan log on to any existing database.
- durationSeconds Integer
- The number of seconds until the returned temporary password expires. Valid values are between 900and3600. Default value is900.
- clusterIdentifier string
- Unique identifier of the cluster that contains the database for which your are requesting credentials.
- dbUser string
- Name of a database user. If a user name matching db_userexists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_userdoesn't exist in the database andauto_createisTrue, a new user is created using the value fordb_userwithPUBLICpermissions. If a database user matching the value fordb_userdoesn't exist andnotisFalse, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database.
- autoCreate boolean
- Create a database user with the name specified for the user named in db_userif one does not exist.
- dbGroups string[]
- List of the names of existing database groups that the user named in db_userwill 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.
- dbName string
- Name of a database that DbUser is authorized to log on to. If db_nameis not specified,db_usercan log on to any existing database.
- durationSeconds number
- The number of seconds until the returned temporary password expires. Valid values are between 900and3600. 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_userexists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_userdoesn't exist in the database andauto_createisTrue, a new user is created using the value fordb_userwithPUBLICpermissions. If a database user matching the value fordb_userdoesn't exist andnotisFalse, 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_userif one does not exist.
- db_groups Sequence[str]
- List of the names of existing database groups that the user named in db_userwill 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_nameis not specified,db_usercan log on to any existing database.
- duration_seconds int
- The number of seconds until the returned temporary password expires. Valid values are between 900and3600. Default value is900.
- clusterIdentifier String
- Unique identifier of the cluster that contains the database for which your are requesting credentials.
- dbUser String
- Name of a database user. If a user name matching db_userexists in the database, the temporary user credentials have the same permissions as the existing user. Ifdb_userdoesn't exist in the database andauto_createisTrue, a new user is created using the value fordb_userwithPUBLICpermissions. If a database user matching the value fordb_userdoesn't exist andnotisFalse, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database.
- autoCreate Boolean
- Create a database user with the name specified for the user named in db_userif one does not exist.
- dbGroups List<String>
- List of the names of existing database groups that the user named in db_userwill 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.
- dbName String
- Name of a database that DbUser is authorized to log on to. If db_nameis not specified,db_usercan log on to any existing database.
- durationSeconds Number
- The number of seconds until the returned temporary password expires. Valid values are between 900and3600. Default value is900.
getClusterCredentials Result
The following output properties are available:
- ClusterIdentifier string
- DbPassword string
- Temporary password that authorizes the user name returned by db_userto log on to the databasedb_name.
- DbUser string
- Expiration string
- Date and time the password in db_passwordexpires.
- Id string
- The provider-assigned unique ID for this managed resource.
- AutoCreate bool
- DbGroups List<string>
- DbName string
- DurationSeconds int
- ClusterIdentifier string
- DbPassword string
- Temporary password that authorizes the user name returned by db_userto log on to the databasedb_name.
- DbUser string
- Expiration string
- Date and time the password in db_passwordexpires.
- Id string
- The provider-assigned unique ID for this managed resource.
- AutoCreate bool
- DbGroups []string
- DbName string
- DurationSeconds int
- clusterIdentifier String
- dbPassword String
- Temporary password that authorizes the user name returned by db_userto log on to the databasedb_name.
- dbUser String
- expiration String
- Date and time the password in db_passwordexpires.
- id String
- The provider-assigned unique ID for this managed resource.
- autoCreate Boolean
- dbGroups List<String>
- dbName String
- durationSeconds Integer
- clusterIdentifier string
- dbPassword string
- Temporary password that authorizes the user name returned by db_userto log on to the databasedb_name.
- dbUser string
- expiration string
- Date and time the password in db_passwordexpires.
- id string
- The provider-assigned unique ID for this managed resource.
- autoCreate boolean
- dbGroups string[]
- dbName string
- durationSeconds number
- cluster_identifier str
- db_password str
- Temporary password that authorizes the user name returned by db_userto log on to the databasedb_name.
- db_user str
- expiration str
- Date and time the password in db_passwordexpires.
- id str
- The provider-assigned unique ID for this managed resource.
- auto_create bool
- db_groups Sequence[str]
- db_name str
- duration_seconds int
- clusterIdentifier String
- dbPassword String
- Temporary password that authorizes the user name returned by db_userto log on to the databasedb_name.
- dbUser String
- expiration String
- Date and time the password in db_passwordexpires.
- id String
- The provider-assigned unique ID for this managed resource.
- autoCreate Boolean
- dbGroups List<String>
- dbName String
- durationSeconds Number
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.