How to create a list of map objects within a JSON object using loop

@jbardin we facing another related issue now, I have raised a query for the same. Im not sure if its because of the above changes we made, but it should not be. Link for reference: LimitExceededException: The requested resource exceeds the maximum number allowed for AWS EB rules. I can confirm whether our solution works once this above issues is resolved.