Migrate Terraform state reference code examples to /static/programs #15750
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR migrates the inline Terraform state reference code examples from the "Migrating from Terraform" documentation page to structured program directories in
/static/programs
, replacing them with the{{< example-program >}}
shortcode for better maintainability and testability.Changes Made
Before: The documentation contained ~218 lines of inline code with manual language choosers and embedded examples for TypeScript, Python, Go, C#, Java, and YAML.
After: All code examples are now stored in structured directories under
/static/programs/terraform-state-reference-*
and referenced with a single shortcode:{{< example-program path="terraform-state-reference" >}}
Structure Created
terraform-state-reference-typescript/
- Complete Node.js project with index.ts, package.json, tsconfig.json, and Pulumi.yamlterraform-state-reference-python/
- Python project with main.py, requirements.txt, and Pulumi.yamlterraform-state-reference-go/
- Go project with main.go, go.mod.txt, and Pulumi.yamlterraform-state-reference-csharp/
- .NET project with Program.cs, .csproj file, and Pulumi.yamlterraform-state-reference-java/
- Maven project with App.java, pom.xml, and Pulumi.yamlterraform-state-reference-yaml/
- YAML project with Pulumi.yaml configurationBenefits
./scripts/programs/test.sh
The examples demonstrate how to read VPC and subnet IDs from a Terraform state file and use them to provision an EKS cluster using Pulumi's Terraform state reference functionality.
Fixes #15683.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
api.pulumi.com
pulumi login --local
(dns block)pulumi -C terraform-state-reference-yaml install
(dns block)pulumi -C terraform-state-reference-java install
(dns block)https://api.github.com/repos/pulumi/pulumi-eks/releases/latest
pulumi -C terraform-state-reference-yaml install
(http block)https://api.github.com/repos/pulumi/pulumi-terraform/releases/latest
pulumi -C terraform-state-reference-yaml install
(http block)node-precompiled-binaries.grpc.io
If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.