code: def _link_policy(self, role):
          
          policy_arn = self.get_policy_arn()
          if role is not None and policy_arn not in role.ManagedPolicyArns:
              role.ManagedPolicyArns.append(policy_arn)
docs: If this source triggers a Lambda function whose execution role is auto-generated by SAM, add the
          appropriate managed policy to this Role.
  
          :param model.iam.IAMROle role: the execution role generated for the function