It may be worth refactoring some of the recursion you’re follow something like cdk does:
https://github.com/aws/aws-cdk/blob/f44ae607670bccee21dfd390effa7d0e8701efd4/packages/%40aws-cdk/aws-apigateway/lib/resource.ts#L328
The reason we wouldn’t use this method outright is because it forces you to use the default resource options. We could simply refactor our looping to be similar, but with options.