do not use aws iam if not opted in

This commit is contained in:
William Will 2025-04-16 05:20:19 +00:00 committed by Jan Larwig
parent e81d50a391
commit 7ce6e861ef
No known key found for this signature in database
GPG Key ID: C2172BFA220A037A
1 changed files with 3 additions and 0 deletions

View File

@ -185,6 +185,9 @@ func buildStandaloneClient(opts options.RedisStoreOptions) (Client, error) {
}
func setupAWSIAMAuth(opts options.RedisStoreOptions, opt *redis.Options) error {
if !opts.UseAWSIAMAuth {
return nil
}
if opts.AWSServiceName != "elasticache" && opts.AWSServiceName != "memorydb" {
return fmt.Errorf("AWS IAM auth is only supported for elasticache and memorydb")
}