Problem which IAM role solves?
Let’s say there are some applications running on EC2instances which need AWS credentials to connect with another AWS resource/service every time.
So to achieve this, a developer can store these credentials within the instance which application can use every time while connecting to another service.
But this seems not to be the right way, as storing credentials is never good instead respective IAM roles can be applied to this instance via which access can be gained.