Steps:

  • Create a Role
  • Grant Access
  • Test Access

Start by logging in to your IAM Dashboard

  • Click on Roles on your left side panel and Create role

Click on the role trusted entity to be created as highlighted in the screenshot: I am creating a compute service that should have access to a storage so i choose EC2

Scroll down to use case and check EC2 then click on next..

  • Add permission, like i highlighted, it needs access to a storage so my permission is to AmazonS3fullAccess

  • Next , Role name pick any your choice for the role hit create role and the role is created.