Skip to content

Add HCL examples for the tier 1 providers - #2986

Merged
iwahbe merged 3 commits into
masterfrom
iwahbe/add-hcl-examples
Aug 26, 2026
Merged

Add HCL examples for the tier 1 providers#2986
iwahbe merged 3 commits into
masterfrom
iwahbe/add-hcl-examples

Conversation

@iwahbe

@iwahbe iwahbe commented Aug 25, 2026

Copy link
Copy Markdown
Member

Adds one Pulumi HCL (runtime: hcl) example per tier 1 provider:

  • aws-hcl-s3-folder — an S3 static website, mirroring aws-ts-s3-folder (Terraform aws provider).
  • azure-hcl-static-website — a static website on Azure Blob Storage (Terraform azurerm + random providers).
  • gcp-hcl-webserver — a web server on a Compute Engine instance, mirroring gcp-go-webserver (Terraform google provider).
  • kubernetes-hcl-guestbook — the guestbook application, mirroring the existing guestbook family (Terraform kubernetes provider).

All providers resolve from the OpenTofu registry through pulumi-terraform-provider, and the HCL language plugin auto-installs, so the examples need no dependency files.

Test coverage

Each example has an integration test: TestAccAwsHclS3Folder, TestAccAzureHcl (definitions-based), TestAccGcpHclWebserver, and a kubernetes-hcl-guestbook entry in TestAccKubernetesGuestbook. The harness's integration.ProgramTest has no prepare step for the hcl runtime, so a shared helpers.HCLPrepareProject runs pulumi install before the first update.

CI wiring: hcl maps to the Hcl test-set suffix in scripts/changed-examples.sh, and AwsHcl, AzureHcl, GcpHcl join all_test_sets() (their runners exist). The Kubernetes example runs under the existing minikube job.

All four were verified locally end to end: the AWS, Azure, and GCP tests pass (deploy, HTTP validation, destroy), and the guestbook was deployed to a kind cluster with MetalLB and served the expected page through its LoadBalancer IP.

pulumi install materializes sdks/<provider>/hcl.sdk.json in HCL projects; these are generated artifacts and are now gitignored.

Closes pulumi/home#4704.

iwahbe added 2 commits August 25, 2026 10:08
Add one Pulumi HCL (runtime: hcl) example per tier 1 provider:

- aws-hcl-s3-folder: an S3 static website, mirroring aws-ts-s3-folder.
- azure-hcl-static-website: a static website on Azure Blob Storage,
  using the Terraform azurerm provider.
- gcp-hcl-webserver: a web server on a Compute Engine instance,
  mirroring gcp-go-webserver.
- kubernetes-hcl-guestbook: the guestbook application, mirroring the
  existing guestbook family.

Each example is covered by an integration test. The integration harness
has no built-in prepare step for the hcl runtime, so a shared
helpers.HCLPrepareProject runs `pulumi install` to fetch the language
plugin and the bridged Terraform providers before the first update.

Wire the new language into CI: `hcl` maps to the Hcl test-set suffix in
scripts/changed-examples.sh, and the AwsHcl, AzureHcl, and GcpHcl sets
join the full sweep now that their runners exist. The Kubernetes example
runs under the existing minikube job via TestAccKubernetesGuestbook.

`pulumi install` materializes sdks/<provider>/hcl.sdk.json files in HCL
projects; ignore them as generated artifacts.

Closes pulumi/home#4704.
CI resolved azurerm 5.x while the examples were verified locally against
4.x, where `azurerm_storage_blob.storage_container_name` still existed.
In 5.x the blob requires `storage_container_id`, so look up the implicit
`$web` container with a data source and reference it by ID.

Pin each example's provider to its current major through
`terraform.required_providers`, so local runs and CI resolve the same
major and a future major release cannot break the nightly sweep.
@iwahbe
iwahbe marked this pull request as ready for review August 25, 2026 08:35
@iwahbe
iwahbe requested a review from jkodroff August 25, 2026 08:36

@unblocked unblocked Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No issues found

About Unblocked

Unblocked has been set up to automatically review your team's pull requests to identify genuine bugs and issues.

📖 Documentation — Learn more in our docs.

💬 Ask questions — Mention @unblocked to request a review or summary, or ask follow-up questions.

👍 Give feedback — React to comments with 👍 or 👎 to help us improve.

⚙️ Customize — Adjust settings in your preferences.

The google provider defaults deletion_protection to true, so every
`pulumi destroy` of this example fails and the nightly GcpGo sweep has
been red since the provider bump. Set it to false: the example's
cluster is disposable by design.
@jkodroff
jkodroff requested a review from cnunciato August 25, 2026 13:56
@iwahbe
iwahbe merged commit 85a37b0 into master Aug 26, 2026
60 of 62 checks passed
@iwahbe
iwahbe deleted the iwahbe/add-hcl-examples branch August 26, 2026 14:53
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.

2 participants