Turns out the issue is easy to fix. I needed to add permission to invoke the lambda by the specific rule. It only confuses me because of the fact that the prettify button will do the work which is nice but not actually the reason why its working. It is working whenever i made any changes and save it via the aws console, that way the eventbridge is smart enough to add the necessary permission to make it. But if you create the rule via a lambda(boto3) it will not automatically add that permission.