Does anyone know what Pulumi does to get the json ...
# general
b
Does anyone know what Pulumi does to get the json schema for terraform providers (that it uses for code-gen purposes) ?
s
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
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
It's all over the place. The schema in TF is defined in Go code.
b
ya, I'm trying to figure out if there's a programmatic way to get it out of a resource