Does anyone have an idea what this error means? ``...
# package-authoring
b
Does anyone have an idea what this error means?
Copy code
.../node_modules/resolve/test/resolver/false_main/package.json: json: cannot unmarshal bool into Go struct field packageJSON.main of type string
p
Looks to me like you're attempting to insert a boolean into a struct field that only accepts string values
1
b
In the context of using pulumi terraform bridge, what might be the root cause?
Or what should I double check?
p
Ah, might be a question for the Pulumi guys...Are you using the boilerplate repo or the Cookiecutter template?
b
I'm using the boilerplate.
p
Gotcha, not sure how far along you are, but I just wrapped up a project using the boilerplate and it was a little more labor intensive than I expected (mainly because the source repo was very old). Regardless, I'd definitely suggest checking out https://github.com/tmeckel/pulumi-tf-provider-cookiecutter which can automate the entire process for you
b
Okay. Is the cookie cutter officially supported? Or does it not matter since it's a one time thing?
p
It hasn't made it into the official documentation yet, but it was recommend to me by @big-architect-71258 (the author) who I think is with Pulumi?
b
Sounds good. He recommended it to me as well, didn't know he was with Pulumi. I'll deff give it a shot.
b
Someone wrote an article to bridge a Terraform provider and mentioned and tested my template. https://thulasirajkomminar.com/how-to-bridge-a-terraform-provider-to-pulumi-623db829f52f
1
b
Does this account for the shim model? Where the provider is in the "/internal" directory?
b
The Cookiecutrer Template detects an internal provider and creates the shim automatically.
b
very nice. For this input
terraform_provider_package_name
is this supposed to be a path?
b
Exactly. Like
internal/provider
Only the path to the provider.go file. Not the
.go
file itself.
b
got it. Thanks
👍🏻 1
@big-architect-71258 Cookie cutter worked like a charm. Amazing work. What's the recommended workflow for if the TF provider gets updated with new resources?
🔥 1
b
Just update the Terraform provider module reference. If you used one of the auto-mapper configurations, you only have to call
make build_sdks
afterwards.
If you opted for manual mapping for resources and data sources, you can use the the codegen from here. https://github.com/tmeckel/pulumi-tf-provider-cookiecutter/tree/master/generator or even manually craft the required changes.
Look at the generated
README-DEVELOPMENT.md
for a complete overview.