Introduction
Sometimes, you want a service or user to do things in your cloud account without sharing your password. IAM roles let you give permissions safely to services or people for a short time without sharing long-term credentials.
When an application running on a server needs to access cloud storage without embedding passwords.
When you want to allow a user from another AWS account to access your resources temporarily.
When a Lambda function needs permission to read from a database.
When you want to give temporary access to a developer without sharing your main credentials.
When an EC2 instance needs to upload files to S3 securely.