AWS CSA Tips – How to attach IAM Role to a EC2

As a rule of thumb always use IAM Roles to give permission to EC2. E.g. make a role called DemoRoleForEC2 and attach the IAMReadOnlyAccess. Then you can attach the DemoRolefForEC2 to your EC2 instance.

iam-role