Jump to Content

Class GetCredentialsCommandProtected

Returns a database user name and temporary password with temporary authorization to log in to Amazon Redshift Serverless.

By default, the temporary credentials expire in 900 seconds. You can optionally specify a duration between 900 seconds (15 minutes) and 3600 seconds (60 minutes).

     <p>The Identity and Access Management (IAM) user or role that runs
GetCredentials must have an IAM policy attached that allows access to all
necessary actions and resources.</p>

<p>If the <code>DbName</code> parameter is specified, the IAM policy must
allow access to the resource dbname for the specified database name.</p>

Example

Use a bare-bones client and the command you need to make an API call.

import { RedshiftServerlessClient, GetCredentialsCommand } from "@aws-sdk/client-redshift-serverless"; // ES Modules import
// const { RedshiftServerlessClient, GetCredentialsCommand } = require("@aws-sdk/client-redshift-serverless"); // CommonJS import
const client = new RedshiftServerlessClient(config);
const command = new GetCredentialsCommand(input);
const response = await client.send(command);

See

Throws

InternalServerException (server fault)

The request processing has failed because of an unknown error, exception or failure.

Throws

ResourceNotFoundException (client fault)

The resource could not be found.

Throws

ValidationException (client fault)

The input failed to satisfy the constraints specified by an AWS service.

Hierarchy

Constructors

Properties

middlewareStack: MiddlewareStack<GetCredentialsCommandInput, GetCredentialsCommandOutput>

Methods