title: How do I connect to AWS RDS MySQL from Java/Spring application using AWS IAM Authentication?
body: <p>I am new to AWS world and still learning. It's been only a month that I am trying things.</p>
  
  <p>I have been looking for it for quite a few days now and haven't been able to find a correct and more appropriate solution. Therefore it would be great if somebody can help me by giving a sample code, provide some pointer or guide in the right direction. </p>
  
  <p>I have a <strong>AWS RDS MySQL</strong> instance and a database created. I have configured "<strong>IAM DB AUthentication Enabled</strong>" to "Yes".</p>
  
  <p>Created an <strong>IAM Role</strong> and <strong>Policy</strong> as per AWS documentation.</p>
  
  <p>And finally, I have an <strong>EC2 instance</strong> with Tomcat with my <strong>Java/Spring application</strong> deployed and running in it. I am able to access the MySQL database using database credentials (like db user name, password, db url, etc.) successfully. So I know things are setup properly now.</p>
  
  <p>Can somebody please help me know how to connect to this database from my Java/Spring application using <strong>spring-jdbc</strong> and <strong>AWS IAM Authentication</strong> (the IAM role I created above)?</p>
  
  <p>I read somewhere that I need the <strong>certificate file</strong> or certificate bundle file in my application environment and that I need to generate a <strong>token</strong> to be connected to the database. But I am not able to think on how to put it together.</p>
  
  <p>Any help will be highly appreciated.</p>
  
  <p>Thanks.</p>