https://pulumi.com logo
#general
Title
# general
c

cool-egg-852

11/20/2019, 5:29 PM
Any reason
vault.Policy
requires the
policy
property as a string instead of an object?
b

broad-dog-22463

11/20/2019, 5:31 PM
👍 this was a community provided provider so I can have a look at that
c

cool-egg-852

11/20/2019, 5:31 PM
It was generated with the terraform generator you guys have, that much I know. Why doesn’t the generator detect stuff like this?
b

broad-dog-22463

11/20/2019, 5:33 PM
does Terraform have a known structure for this?
c

cool-egg-852

11/20/2019, 5:33 PM
No idea
b

broad-dog-22463

11/20/2019, 5:33 PM
I thought they needed a string
c

cool-egg-852

11/20/2019, 5:33 PM
Ah, so it’s terraform’s poor design that caused this, gotcha.
b

broad-dog-22463

11/20/2019, 5:48 PM
We can of course add this 🙂
I need to find the structure of the policy!
then we can add it
c

cool-egg-852

11/20/2019, 5:49 PM
Gotcha. At minimum it would be good to just have it support a generic object
b

broad-dog-22463

11/20/2019, 5:55 PM
👍
w

white-balloon-205

11/20/2019, 7:11 PM
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

cool-egg-852

11/20/2019, 8:02 PM
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

white-balloon-205

11/20/2019, 8:07 PM
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

cool-egg-852

11/20/2019, 8:08 PM
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

white-balloon-205

11/20/2019, 8:10 PM
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

cool-egg-852

11/20/2019, 8:11 PM
Gotcha.
Semi-related, any plans for having enums for values? This way we don’t have to do strings for everything?
w

white-balloon-205

11/20/2019, 8:18 PM
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

cool-egg-852

11/20/2019, 8:18 PM
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

white-balloon-205

11/20/2019, 8:19 PM
I suspect that enum does not exist today - but it could. We have enums for EC2 instance types for example.
c

cool-egg-852

11/20/2019, 8:20 PM
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

white-balloon-205

11/20/2019, 8:21 PM
Right - can't be done automatically today - but can be added manually - PRs definitely welcome!
c

cool-egg-852

11/20/2019, 8:22 PM
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.