-
Notifications
You must be signed in to change notification settings - Fork 37
Consider getting provider schema using Terraform CLI #131
Comments
FYI, I noticed that the schema struct doesn't seem to be using json tags that would allow us to easily unmarshal/marshal. |
@muvaf could you elaborate?
See: aws-provider-schema.json.txt So, if we would like to go with this approach, it looks like we would need to make changes in types package such that it uses types in hashicorp/terraform-json instead. |
The types in plugin-sdk don't have
I thought maybe we can have a conversion similar to what we do with plugin sdk v1 schema but if the difference is small, we can just change the underlying data type in types package to this one as you suggested and even remove v1 conversion since the input will always be the same no matter what version of plugin sdk provider uses. If you decide to do that, feel free to close this issue since it's mostly for discovery. |
Ah ok, I am confused since the output of
I would prefer to completely remove plugin sdk dependency (in favor of hashicorp/terraform-json) if our input will always be the cli output. However, a conversion as you mentioned might give us the opportunity to gradually experiment that approach, e.g. new ones will use cli output by default but existing ones can migrate later, which sounds like a good approach 👍 |
What problem are you facing?
Today, we are generating CRD schemas by importing the package with the schema definition from Terraform provider codebase. While this worked well so far, we should consider breaking this dependency because:
internal
directory which prevents importing them as is (and needs some workarounds)How could Terrajet help solve your problem?
As suggested in the Terraform docs, we can just use the Terraform CLI to fetch the schema of the Provider and break go module dependency.
The text was updated successfully, but these errors were encountered: