added intelligence for handling IAM roles as well as credentials files.