https://pulumi.com logo
Title
b

busy-island-31180

12/13/2022, 1:15 AM
Does anyone know what Pulumi does to get the json schema for terraform providers (that it uses for code-gen purposes) ?
s

stocky-restaurant-98004

12/13/2022, 2:09 AM
You're referring to bridged Pulumi providers, which take Terraform providers as an internal dependency. The code that generates the Pulumi schema from the Terraform schema is in the
tfgen
package of `pulumi-terraform-bridge`: https://github.com/pulumi/pulumi-terraform-bridge/tree/master/pkg/tfgen
In any bridged provider, there's a
make tfgen
target that generates `schema.json`: https://github.com/pulumi/pulumi-artifactory/blob/main/Makefile#L22-L25
tfgen
iterates the TF schema and docs and uses them to generate the equivalent Pulumi schema.
b

busy-island-31180

12/13/2022, 3:55 AM
ah thanks for pointing me to that
so, where does the terraform schema come from?
I was looking at the terraform aws provider, and I couldn't find where that might be in the repo
s

stocky-restaurant-98004

12/13/2022, 11:31 AM
It's all over the place. The schema in TF is defined in Go code.
b

busy-island-31180

12/13/2022, 7:41 PM
ya, I'm trying to figure out if there's a programmatic way to get it out of a resource