Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Consider a variable that makes the module/resources optional #21

Open
lorengordon opened this issue Jul 26, 2018 · 0 comments
Open

Consider a variable that makes the module/resources optional #21

lorengordon opened this issue Jul 26, 2018 · 0 comments

Comments

@lorengordon
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant