SDK for PHP 3.x

AuthTokenGenerator
in package

Generates RDS auth tokens for use with IAM authentication.

Table of Contents

Methods

__construct()  : mixed
The constructor takes an instance of Credentials or a CredentialProvider
createToken()  : string
Create the token for database login

Methods

__construct()

The constructor takes an instance of Credentials or a CredentialProvider

public __construct(callable|Credentials $creds) : mixed
Parameters
$creds : callable|Credentials

createToken()

Create the token for database login

public createToken(string $endpoint, string $region, string $username[, int $lifetime = 15 ]) : string
Parameters
$endpoint : string

The database hostname with port number specified (e.g., host:port)

$region : string

The region where the database is located

$username : string

The username to login as

$lifetime : int = 15

The lifetime of the token in minutes

Return values
string

Token generated

On this page