Any reason `vault.Policy` requires the `policy` pr...
# general
c
Any reason
vault.Policy
requires the
policy
property as a string instead of an object?
b
đź‘Ť this was a community provided provider so I can have a look at that
c
It was generated with the terraform generator you guys have, that much I know. Why doesn’t the generator detect stuff like this?
b
does Terraform have a known structure for this?
c
No idea
b
I thought they needed a string
c
Ah, so it’s terraform’s poor design that caused this, gotcha.
b
We can of course add this 🙂
I need to find the structure of the policy!
then we can add it
c
Gotcha. At minimum it would be good to just have it support a generic object
b
đź‘Ť
w
Yep - allowing typed JSON object here would be nice. FWIW- if all you care about is “a generic object” (and thus no strong typing), you can just do
JSON.stringify({...})
.
c
Yep, I just dislike having to add anything extra.
So I always feel like pulumi should offer generic objects at minimum and then add typing where possible.
w
Pulumi offers the raw string input the same as the Terraform schema, and then adds typing where Terraform providers are really trying to represent schematized JSON data.
c
Right, but at least supporting generic objects without typing removes the need to stringify json. This solves a huge issue with the #1 usability issue of pulumi which is interpolation.
w
Understood. There's no way to automatically identify these places from TF schema - so they will always require manual annotation. And if we are doing manual annotation we may as well include the types. So this isn't a "no" it's a "we can and do try to do even better whenever we see the opportunity to do this at all".
c
Gotcha.
Semi-related, any plans for having enums for values? This way we don’t have to do strings for everything?
w
We do in many places also augment raw TF schema with enums. It currently has to be added manually - as there is no schematization of what enum values are allowed to drive from. But PRs always welcome for additional places enums should be supported in addition to raw string values.
c
Ho do you use the enums then? I’ve not seen it done anywhere so far.
For example, if I want to create a GKE NodePool, can I select
gcp.gke.NodePool.n1standard1
for example or something of the sort?
w
I suspect that enum does not exist today - but it could. We have enums for EC2 instance types for example.
c
Ideally any value for anything that has specific known values would have enums.
For example, in the vault, the
Group
type of
internal
vs
external
, the GCP instance types, etc.
w
Right - can't be done automatically today - but can be added manually - PRs definitely welcome!
c
I’d love to help, unfortunately working with Go is a nightmare. I’m always shocked when I see any projects working with it. It’s always the barrier to entry I’ve had to contribute back to pulumi.
Also contributing requires changes in many different languages for those that work on the SDK more directly.