terraform icon indicating copy to clipboard operation
terraform copied to clipboard

Add 'else if' expression for template rendering

Open mschuchard opened this issue 5 years ago • 9 comments

Current Terraform Version

0.12.26

Use-cases

In Terraform template files, we could use an else if expression in addition to if and else.

Attempted Solutions

We could of course currently do nested if/else for this, but it is messy.

Proposal

Add the else if/elseif/elsif expression to the template rendering engine.

References

n/a

Other

I searched the issue tracker here and could not find an open FR for this. If this is a duplicate, please let me know.

mschuchard avatar Jun 19 '20 16:06 mschuchard

+1

RuiSMagalhaes avatar Dec 20 '21 21:12 RuiSMagalhaes

+1

lukczarnota avatar Jul 06 '22 21:07 lukczarnota

+1 on that. Any progress?

MattDelac avatar Sep 09 '22 21:09 MattDelac

+1

luis-guimaraes-exoawk avatar Sep 14 '22 10:09 luis-guimaraes-exoawk

really, this does not exist?!! 👍

faust64 avatar Nov 02 '22 14:11 faust64

It would be kind of a decent "feature" :)

lethargosapatheia avatar Nov 15 '22 13:11 lethargosapatheia

+1 This addition would be extremely useful and highly appreciated.

thomaspretto avatar Jan 04 '23 22:01 thomaspretto

Just a reminder to please use the 👍 reaction on the original post to upvote issues - we do sort by most upvoted to understand which issues are the most important. This also reduces "noise" in the notification feed for folks following this issue. Thanks!

crw avatar Jan 07 '23 00:01 crw

150 👍 and counting!

jeremych1000 avatar Jun 10 '25 16:06 jeremych1000