Documentation ¶
Overview ¶
rdsiamwrap wraps a database/sql/driver.Driver to provide AWS authentication to RDS databases. Doing this authentication using the rdsutils package alone works for an initial connection but fails if new connections need to be established but the token has expired. This package generates this token as needed using provided AWS credentials.
Index ¶
Constants ¶
View Source
const ( // Get a new token after this duration if none is specified in the driver struct. // AWS's default lifetime is 15 minutes. DefaultTokenLifetime = time.Minute * 14 // one minute under 15 minute documented expiration )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct { // The actual driver to be wrapped Driver driver.Driver // Address of the RDS instance Addr string // AWS region of the RDS instance Region string // Database username: should be the role name User string // Name of the database DBName string // AWS credentials for authentication Creds *credentials.Credentials // Parameters to pass Params url.Values // How long to use an auth token. If unset DefaultTokenLifetime is used TokenLifetime time.Duration // contains filtered or unexported fields }
Driver implements the sql.driver.Driver interface to provide AWS IAM authentication around an existing driver.
Click to show internal directories.
Click to hide internal directories.