title: How to retrieve temporary AWS credentials from Amazon using IAM role associated with the EC2 instance(in java)?
body: <p>I created IAM role associated with the EC2 instance on AMAZON and as I understood from the amazon docs I can retrieve temp AWS credentials and do some stuff with that.I read that the EC2 metadata api(which is used internally by InstanceProfileCredentialsProvider) is only available for calls from within the instance, not from the outside world.
  What this means? How can I get secure communication with AWS when develop app on local tomcat server?</p>