setProvider always takes a function or a string.
Add better logging.
Fix CloudWatch provider function.