4 ms·
edit: fixed a mistake where I put imperative instead of declarative So what I get from this is that Pulumi is declarative, but authoring Pulumi is imperative (
by shepherdjerred 4y ago
edit: fixed a mistake where I put imperative instead of declarative
So what I get from this is that Pulumi is declarative, but authoring Pulumi is imperative (unless you’re using an declarative language, which afaik Pulumi doesn’t support any).
I’m a pretty pedantic person, so I’d probably make this same argument once I had the knowledge. I don’t see what it changes for a developer though. If I’m writing imperative code then the tool running my IaC might as well be imperative. I guess it’s a cool piece of trivia to know though.
- andreareina 4y agoBy that logic everything is imperative. Authoring the data structure for whatever IaC tool is going to take on the characteristics of however you author it. Is the same yaml detailing the desired state declarative when I hand-write it and imperative when I use some language to generate it?
- shepherdjerred 4y agoI would say yes. If you're writing that YML by hand, and that YML doesn't have extensions that provides control-flow (e.g. CloudFormation's if syntax), then you're writing something declarative. If you're using an imperative language, and you're using control-flow, then you're using that tool in an imperative way. It doesn't make sense to define the attributes of a tool by its artifacts. If we applied that logic across the board then Haskell isn't a purely functional language because it eventually gets compiled to machine code which is imperative. What matters is the source, not the artifact. In the case of Pulumi you are using imperative languages, so Pulumi is effectively imperative, although it can technically be considered declarative when you consider the Pulumi runtime. If Pulumi had support for a declarative language, then I would consider it a declarative tool.
- hosh 4y agoI wrote my own Ruby code to manage Kubernetes manifests. Instead of messing with templates, I generate or transform manifests, sometimes functionally, sometimes not. Declarative is necessary if one is trying to have something maintain a desired state and do what is necessary to move the current state to the desired state. I wonder if this is why I hear a lot of people say K8S is complex. I mean, it isn’t simple, but it isn’t _that_ complex.
- jen20 4y ago> unless you’re using an declarative language, which afaik Pulumi doesn’t support any Pulumi has a YAML evaluator, with many of the same limitations of Terraform being imposed.