3 ms·
I suspect you could implement this as a Haskell DSL. The discussion part where you are not allowed (from Terraform lang) to create behavior dependent on the ac
by treetide 4y ago
I suspect you could implement this as a Haskell DSL.
The discussion part where you are not allowed (from Terraform lang) to create behavior dependent on the actual values of "Unknown" values (to prevent an ambiguous / non-deterministic plan), reminds of Applicatives vs Monads a bit.
(Sketchy potentially non-100% true illustration ahead)
For example, if you write a command-line parsing library using a Monad, then the set of command-line options is not an upfront fixed set easy to list with --help, but can change depending on previous command line options (here the command line parsing can peek into the upfront "Unknown" values, the options used and their values, to generate even more options).
While if you write it using Applicative, then peeking into the actual values is not possible, you can't create branching behaviour.
- treetide 4y ago...but maybe you don't need to go as far as Haskell. Any language with generics could work, like Java. (Or well, void pointers or anonymous interfaces..). Just make sure the user-written plan code doesn't get any meaningful info about the unknown values, only able to pass it around.
- JamesSwift 4y agoYes, Pulumi has the concept of `Input` and `Output`. You need to unwrap an `Output` to inspect the computed value, but that unwrap only exists because Pulumi allows you to. EDIT: and note that Pulumi has language targets in C#, Typescript, golang, and Python