title: Testing application locally that uses IAM Role
body: <p>I have a Java application which does adds files in S3. This application is running in a EC2 instance.</p>
  
  <p>We are using IAM role. So we have attached the required IAM role to this EC2 instance. </p>
  
  <p>Everything works perfect there. </p>
  
  <p>But we would like to test the application locally in my laptop as well. It's hard to upload the application everytime to EC2 whenever I need to test it.</p>
  
  <p>How can we switch dynamically without changing the code, so that I can test it my laptop (with accesskey and secretKey) as well as use IAM role in EC2?</p>