File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,8 @@ will be fetched as necessary and used for connections until it
358358expires.  The value for : host_region  will either use the one provided,
359359or if not provided, the environment variable AWS_REGION.
360360
361+ You must add the ` aws-sdk-rds `  gem to your bundle to use this functionality.
362+ 
361363|  ` :use_iam_authentication `  |  true                                 | 
362364|  ---                       |  ---                                  | 
363365|  ` :username `                |  The database username configured to use IAM Authentication | 
Original file line number Diff line number Diff line change 11require  'singleton' 
2- require  'aws-sdk-rds' 
32
43module  Mysql2 
54  class  AwsTokenAuth 
@@ -10,6 +9,13 @@ class AwsTokenAuth
109    TOKEN_EXPIRES_IN  =  ( 60 *14 )  # 14 minutes 
1110
1211    def  initialize 
12+       begin 
13+         require  'aws-sdk-rds' 
14+       rescue  LoadError 
15+         puts  "gem aws-sdk-rds was not found.  Please add this gem to your bundle to use AWS IAM Authentication." 
16+         exit 
17+       end 
18+ 
1319      @mutex  =  Mutex . new 
1420      # Key identifies a unique set of authentication parameters 
1521      # Value is a Hash 
Original file line number Diff line number Diff line change @@ -24,5 +24,4 @@ Mysql2::GEMSPEC = Gem::Specification.new do |s|
2424  s . metadata [ 'msys2_mingw_dependencies' ]  =  'libmariadbclient' 
2525
2626  s . add_runtime_dependency  'bigdecimal' 
27-   s . add_runtime_dependency  'aws-sdk-rds' 
2827end 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments