Conversation
Signed-off-by: somaz <genius5711@gmail.com>
somaz94
marked this pull request as ready for review
August 14, 2026 06:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of your changes
terraform_dataandterraform_remote_statecome from Terraform's built-in provider, which isn't published on the registry. InloadResourcesthere is norequired_providersentry to read a source from, so it falls back to synthesizinghashicorp/terraform(terraform/load.go:486-491), which is the deprecated external provider, andResource.URL()then builds a registry link out of that. The generated link doesn't resolve.This adds a carve-out in
URL()that maps the built-in provider's resources to the Terraform language docs instead.terraformis a reserved provider local name and can't be declared inrequired_providers, soProviderName == "terraform"is enough to identify the built-in provider unambiguously. An unrecognized built-in type returns an empty URL, which the resource templates already fall back to rendering as a plain spec.Fixes #757
I have:
make test.How has this code been tested
Added three cases to
TestResourceURL: a built-in resource, a built-in data source, and an unrecognized built-in type.make checkfmt,make testandmake staticcheckall pass locally.make lintreports 9 issues, but they're all pre-existing: I get the identical 9 from a cleanmasterworktree, and none of them are in the files this PR touches.I also rendered a fixture module containing
terraform_data,terraform_remote_stateandtls_private_key.Before:
After:
The
tls_private_keyrow is unchanged.