Skip to content

Conversation

@t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Jun 25, 2025

Updates examples on the https://www.pulumi.com/docs/iac/extending-pulumi/use-terraform-module/ page to use language choosers to explain every supported language.

Code was tested through pulumi preview.

Fixes pulumi/pulumi-terraform-module#390


return await Deployment.RunAsync(() =>
{
// Get available availability zones
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

Some modules require Terraform providers to be configured with specific settings. You can configure these providers from within Pulumi:
**Example:** index.ts - Configuring the imported Terraform bucket module*
{{% chooser language "typescript,python,go,csharp,java" %}}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a problem formulating this with YAML:

pulumi/pulumi-yaml#824

return err
}
// Use the provider with the module
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

@pulumi-bot
Copy link
Collaborator

@t0yv0 t0yv0 requested a review from a team June 25, 2025 23:49
@t0yv0 t0yv0 marked this pull request as ready for review June 25, 2025 23:49
@pulumi-bot
Copy link
Collaborator

@t0yv0 t0yv0 requested a review from thoward June 25, 2025 23:52

{{% choosable language yaml %}}

When authoring in YAML, there's no need for Pulumi to generate a SDK. In the YAML you can reference the Terraform module by its schema token, which takes the format `<module-name>:index:Module`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. iirc, we do actually generate a sdks/vpc/vpc-5.19.0.yaml that captures the parameterization. (Since the provider is allowed to serialize a arbitrary blob there to pass between the pulumi package add invocation and the program runtime.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point I can demonstrate that.

@pulumi-bot
Copy link
Collaborator

@t0yv0 t0yv0 enabled auto-merge (squash) June 26, 2025 14:39
@pulumi-bot
Copy link
Collaborator

@t0yv0 t0yv0 merged commit a005c95 into master Jun 26, 2025
8 checks passed
@t0yv0 t0yv0 deleted the t0yv0/module-examples-cross-lang branch June 26, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add examples in other languages to docs

4 participants