Documentation ¶
Overview ¶
Package awsmysql provides shortcut functions to retrieve MySQL credentials from AWS Secrets Manager profile.
Usage:
cfg, err := awsmysql.Config(ctx, "production/dbhost") if err != nil { return err } // adjust config setting timeouts, database name, etc: // see https://pkg.go.dev/github.com/go-sql-driver/mysql#Config cfg.DBName = "data" connector, err := mysql.NewConnector(cfg) // package github.com/go-sql-driver/mysql if err != nil { return err } db := sql.OpenDB(connector)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Config ¶
Config is a shortcut function that creates AWS SDK session and fetches MySQL credentials from specific AWS Secrets Manager profile.
func ConfigFromSecrets ¶
func ConfigFromSecrets(ctx context.Context, svc *secretsmanager.Client, profile string) (*mysql.Config, error)
ConfigFromSecrets fetches MySQL credentials from specific AWS Secrets Manager profile using provided SecretsManager AWS SDK client.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.