Skip to content

Commit

Permalink
Do not hit AWS API when RDS idenfier is in config
Browse files Browse the repository at this point in the history
  • Loading branch information
jlisthood committed Dec 19, 2022
1 parent 8a3f868 commit 0a4ffa9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions util/awsutil/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ var IdentifierMap *util.TTLMap = util.NewTTLMap(5 * 60)
var ErrorCache *util.TTLMap = util.NewTTLMap(10 * 60)

func FindRdsIdentifier(config config.ServerConfig, sess *session.Session) (identifier string, err error) {
if config.AwsDbInstanceID != "" {
identifier = config.AwsDbInstanceID
return
}

identifier = IdentifierMap.Get(config.AwsDbInstanceID)
if identifier != "" {
return
Expand Down

0 comments on commit 0a4ffa9

Please sign in to comment.