https://pulumi.com logo
Title
d

delightful-fall-80513

11/22/2022, 9:31 AM
Hey everyone, I’ve got a quick question, is it possible to generate Pulumi schemas from something like an OpenAPI spec? If so, how is this currently done?
g

gorgeous-country-43026

11/22/2022, 9:43 AM
"Pulumi schemas"? Just out of curiosity, what are you expecting to get if such a functionality exists?
I'm asking this because OpenAPI spec defines a way to describe REST APIs etc in a way that it is easy to generate documentation for it and to generate client stubs etc
Pulumi is about infrastructure
It does not correspond to application logic in any way. Or well, if used within an application in automation mode then kinda, but basically no.
d

delightful-fall-80513

11/22/2022, 9:46 AM
Thanks for getting back to me. By Pulumi schemas, I’m referring to the schemas used to generate SDK code, found here: https://www.pulumi.com/docs/guides/pulumi-packages/schema/.
My question really is, given something like an AWS OpenAPI spec, is there a way to generate schema for functionality like creating a bucket etc?
g

gorgeous-country-43026

11/22/2022, 9:47 AM
Right so you want to create a new provider?
For Your Own Public Cloud(tm) or similar?
d

delightful-fall-80513

11/22/2022, 9:48 AM
Yeah, investingating different options at the moment
g

gorgeous-country-43026

11/22/2022, 9:48 AM
Ok, well that is a not so typical use case but totally valid one
But I think community in general has very little experience on that, I guess Pulumi devs can hop in at some point
But in general Pulumi supports several languages and one of the main reasons why it can do that is since the providers are auto-generated
So I would lean towards "yes it is possible" but I'm not sure if it is something that is easy to do yourself
d

delightful-fall-80513

11/22/2022, 9:51 AM
Right, I see. I was brought to wonder if schemas were generated after briefly looking at the schema for the AWS provider. Its obiously possible for that to be written by hand but I was curious if it happened to be generated based on, as mentioned, something like an open api spec or similar. For us this would greatly decrease the amount of work we have to do. Maybe it is a bit of a pipe dream though 🙂
g

gorgeous-country-43026

11/22/2022, 9:52 AM
I'm sure those are generated but I have no idea how much setup that pipeline needs
But for AWS there is no reason to generate anything, it's already there. But I guess that was just an example and your real use case is for something else
d

delightful-fall-80513

11/22/2022, 9:53 AM
Yeah, was an example
Thanks anyway for the help, any idea where else I could go to seek an answer? Maybe Git issues?
g

gorgeous-country-43026

11/22/2022, 9:54 AM
Just wait until devs pop by and notice this 🙂
They hang around here but obviously aren't here 24/7
d

delightful-fall-80513

11/22/2022, 9:54 AM
Ok, great. Thanks
b

billowy-army-68599

11/22/2022, 4:46 PM
@delightful-fall-80513 it’s feasible yes. The Native providers like Kubernetes operate by downloading the spec (in Kubernetes case, swagger) and then transforming it into a Pulumi schema: https://github.com/pulumi/pulumi-kubernetes/tree/master/provider/cmd/pulumi-gen-kubernetes
d

delightful-fall-80513

11/22/2022, 5:14 PM
Perfect. Thank you so much!