get Cluster Credentials
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"])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 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
})
}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}Return
A collection of values returned by getClusterCredentials.
Parameters
A collection of arguments for invoking getClusterCredentials.
Return
A collection of values returned by getClusterCredentials.
See also
Parameters
Create a database user with the name specified for the user named in db_user if one does not exist.
Unique identifier of the cluster that contains the database for which your are requesting credentials.
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 to PUBLIC.
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.
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. If db_user doesn't exist in the database and auto_create is True, a new user is created using the value for db_user with PUBLIC permissions. If a database user matching the value for db_user doesn't exist and not is False, then the command succeeds but the connection attempt will fail because the user doesn't exist in the database.
The number of seconds until the returned temporary password expires. Valid values are between 900 and 3600. Default value is 900.
Return
A collection of values returned by getClusterCredentials.
See also
Parameters
Builder for com.pulumi.aws.redshift.kotlin.inputs.GetClusterCredentialsPlainArgs.