rds_build_auth_token_v2 function

Generates an auth token used to connect to a db with IAM credentials.

Generates an auth token used to connect to a db with IAM credentials.

See list("IAM Database Authentication for MySQL and PostgreSQL")

for more information on using IAM database authentication with RDS.

rds_build_auth_token_v2(DBHostname, Port, DBUsername, Region = NULL)

Arguments

  • DBHostname: [required] The hostname of the database to connect to.
  • Port: [required] The port number the database is listening on.
  • DBUsername: [required] The username to log in as.
  • Region: The region the database is in. If NULL, the client region will be used.

Returns

A presigned url which can be used as an auth token.

Examples

## Not run: # This example gets an authentication token for an RDS database, then # connects to the database using the token. host <- "database-1.cluster-abcdef123456.us-east-1.rds.amazonaws.com" port <- 3306 user <- "jane_doe" token <- svc$build_auth_token_v2( DBHostname = host, Port = port, user = user ) conn <- DBI::dbConnect( drv = RMariaDB::MariaDB(), user = user, password = token, host = host, port = port, client.flag = RMariaDB::CLIENT_SSL ) ## End(Not run)

See Also

rds_build_auth_token

  • Maintainer: Dyfan Jones
  • License: Apache License (>= 2.0)
  • Last published: 2025-03-14

Downloads (last 30 days):