Skip to content

Add component registry source resolution support to Terraform Stacks#37888

Merged
jpogran-hashi merged 8 commits intomainfrom
jpogran/add_registry_component_source_support
Dec 10, 2025
Merged

Add component registry source resolution support to Terraform Stacks#37888
jpogran-hashi merged 8 commits intomainfrom
jpogran/add_registry_component_source_support

Conversation

@jpogran-hashi
Copy link
Copy Markdown
Contributor

This change implements the missing component source resolution case in the stack configuration loader, enabling Terraform Stacks to properly handle component registry sources from HCP Terraform and other component registries.

The implementation mirrors the existing module registry resolution workflow, where component sources are first resolved to their versioned form using the source bundle's component metadata, then converted to final source addresses that can be used to locate the actual component code. This completes the integration between the terraform-registry-address component parsing capabilities and the go-slug sourcebundle component resolution APIs.

Fixes #

Target Release

1.15.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@jpogran-hashi jpogran-hashi self-assigned this Nov 10, 2025
@mjyocca mjyocca added 1.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged and removed 1.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged labels Dec 3, 2025
@mjyocca mjyocca force-pushed the jpogran/add_registry_component_source_support branch from d93fbe2 to 2c4787c Compare December 3, 2025 22:12
@mjyocca
Copy link
Copy Markdown
Collaborator

mjyocca commented Dec 3, 2025

We'd like to target 1.14. Should we apply the backport label or change the target branch?

@mjyocca mjyocca added the 1.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Dec 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 4, 2025

Backported dependency change

This PR makes changes to dependencies in go.mod file(s) and is labelled for backport.

Notice to the maintainer: Before merging the backport of this PR please follow our security scanning processes.

@jpogran-hashi jpogran-hashi marked this pull request as ready for review December 4, 2025 18:22
@jpogran-hashi jpogran-hashi requested review from a team as code owners December 4, 2025 18:22
@jpogran-hashi jpogran-hashi force-pushed the jpogran/add_registry_component_source_support branch from 10b50f0 to 85a9cb4 Compare December 4, 2025 20:38
Copy link
Copy Markdown
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

% TF_ACC=1 go test -count=1 ./...
go: downloading github.com/hashicorp/go-slug v0.18.1
ok      github.com/hashicorp/terraform/internal/backend/remote-state/s3 209.243s

Copy link
Copy Markdown

@BBBmau BBBmau left a comment

Choose a reason for hiding this comment

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

LGTM on gcs side!

󰀵 mau  …/backend/remote-state/gcs   jpogran/add_registry_component_source_support   v1.25.0   14:17   TF_ACC=1 go test -count=1 ./...
go: downloading cloud.google.com/go/kms v1.15.5
ok      github.com/hashicorp/terraform/internal/backend/remote-state/gcs        79.204s

jpogran-hashi and others added 8 commits December 9, 2025 10:04
This change implements the missing component source resolution case in the stack configuration loader, enabling Terraform Stacks to properly handle component registry sources from HCP Terraform and other component registries.

The implementation mirrors the existing module registry resolution workflow, where component sources are first resolved to their versioned form using the source bundle's component metadata, then converted to final source addresses that can be used to locate the actual component code. This completes the integration between the terraform-registry-address component parsing capabilities and the go-slug sourcebundle component resolution APIs.
@jpogran-hashi jpogran-hashi force-pushed the jpogran/add_registry_component_source_support branch from 85a9cb4 to ddc1d11 Compare December 9, 2025 15:04
@jpogran-hashi jpogran-hashi merged commit 2c075b9 into main Dec 10, 2025
9 checks passed
@jpogran-hashi jpogran-hashi deleted the jpogran/add_registry_component_source_support branch December 10, 2025 14:16
dsa0x pushed a commit that referenced this pull request Dec 10, 2025
…37888)

* Add component registry source resolution support to Terraform Stacks

This change implements the missing component source resolution case in the stack configuration loader, enabling Terraform Stacks to properly handle component registry sources from HCP Terraform and other component registries.

The implementation mirrors the existing module registry resolution workflow, where component sources are first resolved to their versioned form using the source bundle's component metadata, then converted to final source addresses that can be used to locate the actual component code. This completes the integration between the terraform-registry-address component parsing capabilities and the go-slug sourcebundle component resolution APIs.

* chore: bump go-slug to v0.18.1

* fix: add case for component final source type

* chore: rm space

* chore: sync module deps

* chore: update testdata with separate bundle

* fix: manifest file json obj with trailing comma

* Add changelog entry to 1.14

---------

Co-authored-by: Michael Yocca <michael.yocca@hashicorp.com>
@github-actions
Copy link
Copy Markdown
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

1.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants