Closed prowlaiii closed 2 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @prowlaiii 👋 Thank you for taking the time to raise this! For changes to how Terraform operates at its core, you'll want to open a feature request in the Terraform Core repository, rather than at the AWS provider level (this repository). With that in mind, I'm going to close this issue.
[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.
Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
I often use a
for_each
statement as an "if" to conditionally deploy resources or modules based on feature flags or other options, but then each resource when its used needs to be presented as if it had an iterator eg.my_resource["yes"]
. Would it be possible to implement an "if" operator instead, which would make the code more readable and also remove the pseudo iterator from calls to it (and also terraform output). Something like:deploy_if = <condition>
rather than:for_each = <condition> ? {deploy="yes"} : {}
or:count = <condition> ? 1 : 0
Affected Resource(s) and/or Data Source(s)
(none)
Potential Terraform Configuration
References
No response
Would you like to implement a fix?
None