Skip to content

Migrate Terraform state reference code examples to /static/programs #15750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 14, 2025

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.yaml
  • terraform-state-reference-python/ - Python project with main.py, requirements.txt, and Pulumi.yaml
  • terraform-state-reference-go/ - Go project with main.go, go.mod.txt, and Pulumi.yaml
  • terraform-state-reference-csharp/ - .NET project with Program.cs, .csproj file, and Pulumi.yaml
  • terraform-state-reference-java/ - Maven project with App.java, pom.xml, and Pulumi.yaml
  • terraform-state-reference-yaml/ - YAML project with Pulumi.yaml configuration

Benefits

  1. Testable Code: Examples are now part of the automated testing pipeline via ./scripts/programs/test.sh
  2. Reusable: Code can be referenced from multiple documentation pages
  3. Maintainable: Updates only need to be made in one location per language
  4. Consistent: Follows established patterns used throughout the docs repository
  5. Cleaner Docs: Dramatically reduces markdown file size and complexity

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
    • Triggering command: pulumi login --local (dns block)
    • Triggering command: pulumi -C terraform-state-reference-yaml install (dns block)
    • Triggering command: pulumi -C terraform-state-reference-java install (dns block)
  • https://api.github.com/repos/pulumi/pulumi-eks/releases/latest
    • Triggering command: pulumi -C terraform-state-reference-yaml install (http block)
  • https://api.github.com/repos/pulumi/pulumi-terraform/releases/latest
    • Triggering command: 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.

Copy link
Contributor Author

Copilot AI commented Aug 14, 2025

@meagancojocar 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@pulumi-bot
Copy link
Collaborator

@Copilot Copilot AI changed the title [WIP] Add the TF stack reference code to /static/programs Migrate Terraform state reference code examples to /static/programs Aug 14, 2025
@Copilot Copilot AI requested a review from meagancojocar August 14, 2025 17:44
Copilot finished work on behalf of meagancojocar August 14, 2025 17: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 the TF stack reference code to /static/programs
3 participants