Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable module with a boolean #33

Closed
dfredell opened this issue Mar 6, 2020 · 3 comments
Closed

Disable module with a boolean #33

dfredell opened this issue Mar 6, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@dfredell
Copy link

dfredell commented Mar 6, 2020

It would be nice to toggle the creation of this whole module with a bool variable, ex create_bastion

This would be something similar to https://github.com/terraform-aws-modules/terraform-aws-eks/pull/588/files

Our use case is, we have one large set of terraforms with modules and we are using a separate terraform.tfvars for every environment and toggle features off and on in there.

@morgante
Copy link
Contributor

morgante commented Mar 6, 2020

Hopefully HashiCorp makes some progress on fixing this in core soon, but happy to accept a PR adding this.

@onetwopunch
Copy link
Contributor

@dfredell we actually do have an option that may suit your needs. Take a look at create_instance_from_template. If set to false, only the instance template is created so that you can use it in your own MIG, but no instances are spun up. We use this for the Bastion Group module. Since no instances are created, your bill should not be affected. Then when you want to create an instance, simply turn it on. If the goal is to not create any resources at all, we would have to add a count on every resource to condtionally turn it off like the module you referenced.

@onetwopunch onetwopunch added the enhancement New feature or request label Apr 2, 2020
@dfredell
Copy link
Author

dfredell commented Apr 3, 2020

That is a good work around. It would also be nice if hashicorp would just add count to all terraform modules.

We actually decided to terraform in IAP to one of our existing instances, so we didn't end up using this module.

@morgante morgante closed this as completed Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants