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

use count instead of for_each to support conditional enabling #302

Conversation

milesmatthias
Copy link

@milesmatthias milesmatthias commented Oct 29, 2019

@morgante
Copy link
Contributor

We specifically didn't do this because count causes issues with reordering APIs.

Could we combine count and for_each?

@milesmatthias
Copy link
Author

@milesmatthias
Copy link
Author

The other option here is to instruct users to use this module conditionally by passing in an empty list, something like this:

  activate_apis = var.enable_apis == "true" ? [
    "redis.googleapis.com",
  ] : []

@morgante
Copy link
Contributor

Could we create a local which simply does that, then for_each over the local?

@milesmatthias
Copy link
Author

I tried that approach, and it generates the same error.

@morgante
Copy link
Contributor

Ok I'm going to try some possible solutions myself.

@morgante
Copy link
Contributor

@milesmatthias PTAL at #303 and confirm it works for your module.

@morgante morgante closed this Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants