More detail
Roles are how software gets AWS permissions. On EC2 the role comes through an instance profile, on ECS it’s the task role, and on Lambda it’s the execution role. A role’s trust policy says who may wear it; its permissions policy says what the wearer can do.