Update the Terraform module docs for the hcl provider - #20709
Conversation
Update the `pulumi package add terraform-module` command to `pulumi package add hcl module` across the Terraform docs, add a runtime module-loading section using the hcl provider, and link the hcl package from the Terraform-to-Pulumi walkthrough. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
||
| ## Load a module at runtime | ||
|
|
||
| Generating an SDK gives you strongly typed inputs and outputs, IDE completion, and a package you can pin and share across your team. When you'd rather trade that type safety for flexibility — for example, to load a module whose address isn't known until runtime — you can use the [`hcl` provider](/registry/packages/hcl/) instead of generating an SDK. |
There was a problem hiding this comment.
Feel free to change the name of this if it should be called something else (the "HCL Module provider", maybe?).
Pre-merge Review — Last updated 2026-08-04T23:38:34ZTip Summary: This PR renames the Terraform-module CLI invocation from Review confidence:
Investigation log
🔍 Verification trail48 claims extracted · 42 verified · 0 unverifiable · 5 contradicted
📊 Editorial balanceSingle-subject post; balance check N/A. 🚨 Outstanding in this PRThese must be resolved or refuted before merging.
|
Social Media Reviewcontent/blog/terraform-to-pulumi-cloud-hands-on/index.mdX — missingLinkedIn — missingBluesky — missing
Suggested copyX (237/255 chars):
LinkedIn (664/2950 chars):
Bluesky (240/300 chars):
Updated for commit |
iwahbe
left a comment
There was a problem hiding this comment.
I marked a bunch of them, but there are more. pulumi package add hcl module takes inputs in this shape:
pulumi package add hcl module <source> [version]
sources is required. version` is optional. There is no way now to pass a name, and doing so will error:
𝛌 pulumi package add hcl module terraform-aws-modules/vpc/aws 6.0.0 vpc
error: failed to get schema: parameterize: rpc error: code = InvalidArgument desc = the hcl provider is parameterized as "module <source> [version]": expected a source and an optional version constraint, got 3 arguments after "module"
| ```bash | ||
| # Add a module from the Terraform Registry | ||
| $ pulumi package add terraform-module terraform-aws-modules/vpc/aws 6.0.0 vpc | ||
| $ pulumi package add hcl module terraform-aws-modules/vpc/aws 6.0.0 vpc |
There was a problem hiding this comment.
| $ pulumi package add hcl module terraform-aws-modules/vpc/aws 6.0.0 vpc | |
| $ pulumi package add hcl module terraform-aws-modules/vpc/aws 6.0.0 |
Address review feedback on the hcl module docs: - Drop the trailing package name from `pulumi package add hcl module` commands; the name is derived from the module source, not passed. - Update use-terraform-module.md and terraform-modules.md examples to the derived package names (vpc, rds), real Pulumi.yaml package blocks (source: hcl), and generated Go import paths. - Use @-delimited version syntax for Pulumi Cloud converted packages. - Refer to the package as "Any HCL Module" in prose, matching the Registry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The hcl provider translates Terraform snake_case variable names to camelCase, unlike the terraform-module provider. Update the VPC and RDS example programs to the correct per-language property names (camelCase for TypeScript/Java/YAML, PascalCase for Go/C#, snake_case unchanged for Python), and fix the C# example to construct the module with Module/ModuleArgs and import Pulumi.Aws.Ec2.Inputs. Verified with go build, tsc, and dotnet build against the generated SDKs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@iwahbe Ok, I think this is all good now. Some of the code was outdated as well, so I've corrected that — but you might notice that the examples now use a different module ( This also happens with the Filed pulumi/pulumi-hcl#514. |
The VPC and VPC+RDS examples used the terraform-aws-modules/vpc/aws
module, which fails to deploy through the hcl provider (a graph-cycle
bug), and pulled in incidental complexity (std/cidrsubnet, provider
config, multi-module wiring). Replace them with the simple, self-
contained terraform-aws-modules/s3-bucket/aws module, which deploys
cleanly and better illustrates the mechanics of consuming a module.
Also:
- Reword the "How It Works" step that inaccurately described translating
Pulumi declarations to Terraform.
- Replace the obsolete "Configuring Terraform Providers" section (its
Provider({ aws }) pattern doesn't exist on the hcl provider) with a
note on ambient provider configuration.
- Fix the relative-paths troubleshooting example to use the runtime
loader, since the typed SDK mis-infers the Lambda module's source_path.
- Remove the Limitations and output-type sections (unverified against
the hcl provider) and the redundant Conclusion.
All examples compile-verified (go build, tsc, dotnet build).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fix a missing article and reword two awkward sentences in the Terraform-module guides. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CamSoper
left a comment
There was a problem hiding this comment.
This looks great, Chris!
Updates the Terraform-module docs for the
hclprovider (the Registry's "Any HCL Module" package):pulumi package add terraform-moduletopulumi package add hcl moduleand refers to the package as "Any HCL Module" in prose; links it from the Terraform-to-Pulumi walkthrough.hcl.Module.@-delimited version syntax for Pulumi Cloud converted packages.terraform-module-only behavior.Examples compile-verified (go build, tsc, dotnet build).