In AWS IAM, We can create the roles, roles has set of polices which determines what is allowed if role has been assumed by a service, a user etc..
If I create a role which has trusted entities as "ec2.amazonaws.com", what basically it means, does it mean we can attach that role to ec2 like profile or is it mean we run terraform from that instance by providing assume role from ec2 or it can be using cli, does it works if I run terraform from another account ec2 instance.
If I run terraform from my local by assuming role, what should be given in trusted entities of that role?