We initially released these modules under AGPL license but found two major drawbacks (a) AGPL does not prevent cloud providers (such as AWS) from building managed services from these modules,Aren't there good solutions within open source licenses? I agree that the AGPL does not solve the stated issue. However, the Apache License version 2.0 has the following text:
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. [...]
I typically use the Apache License version 2 and include a NOTICE file with something like
This software contains portions of XYZ, which was developed by Daniël de Kok.
I do get contacted every once in a while by a company that wants to use my software, but does not want to include this notice in their software/documentation and offer to pay to remove the notice. You could even make it a bit nefarious like:
This software uses XYZ, but your software/service vendor is a cheapskate that leaches off XYZ and kills puppies by not contributing back to XYZ.
And offer the option to obtain a (proprietary) license that allows use with removal of the notice. IANAL, and I don't know if the Apache License's NOTICE wording also covers use in cloud services (it seems so). If not, it would be an easy extension. And the outcome is much better than the abomination that Commons Clause is: the software stays open source and it puts pressure on downstream users to contribute back.