This repository was archived by the owner on Jun 8, 2022. It is now read-only.

Description
Since terraform doesn't support using count on modules (open issue), it is rather difficult to optionally include a module in a terraform config. The pattern I've seen to work around this has been to expose a new variable, maybe something like create_module or create_lambda, and use that to interpolate the count in every resource within the module. Yeah, it's a bit ugly.
Here's an example of what I mean:
In particular, I find I need to do this rather often when writing configs that need to work both in the commercial regions and in the GovCloud regions. Since GovCloud is missing a lot of services, I need a way to make certain resources optional when it's the target region.
I'd be willing to work this if you like.