> The documentation suggests adding the AmazonEC2RoleforSSM policy to the role of the EC2 instances
Which documentation do you mean? The article mentions the policy AmazonSSMManagedInstanceCore, which is the same as what's mentioned in the SSM setup guide:
https://docs.aws.amazon.com/systems-manager/latest/userguide...