github.com/aavshr/aws-sdk-go@v1.41.3/service/rds/doc_custom.go (about) 1 // IAM User or Role Database Authentication 2 // 3 // The rdsutil package's BuildAuthToken function provides a connection 4 // authentication token builder. Given an endpoint of the RDS database, 5 // AWS region, DB user, and AWS credentials the function will create an 6 // presigned URL to use as the authentication token for the database's 7 // connection. 8 // 9 // The following example shows how to use BuildAuthToken to create an authentication 10 // token for connecting to a MySQL database in RDS. 11 // 12 // authToken, err := rdsutils.BuildAuthToken(dbEndpoint, awsRegion, dbUser, awsCreds) 13 // 14 // // Create the MySQL DNS string for the DB connection 15 // // user:password@protocol(endpoint)/dbname?<params> 16 // dnsStr = fmt.Sprintf("%s:%s@tcp(%s)/%s?tls=true", 17 // dbUser, authToken, dbEndpoint, dbName, 18 // ) 19 // 20 // // Use db to perform SQL operations on database 21 // db, err := sql.Open("mysql", dnsStr) 22 // 23 // See rdsutil package for more information. 24 // http://docs.aws.amazon.com/sdk-for-go/api/service/rds/rdsutils/ 25 package rds