fix: declare the nullplatform provider source in the install example - #19
Merged
Conversation
Without a required_providers block OpenTofu infers the provider source as hashicorp/nullplatform, so `tofu init` — the command the README tells operators to run right after copying the example — fails with: provider registry registry.opentofu.org does not have a provider named registry.opentofu.org/hashicorp/nullplatform Adds a versions.tf declaring nullplatform/nullplatform. No version constraint is set on purpose: both tofu-modules dependencies already require `~> 0.0.86`, so a root pin contributes no floor and only risks an unsatisfiable ceiling once the provider moves past 0.1.0. Verified that the example now runs `tofu init -backend=false` and `tofu validate` cleanly.
jcastiarena
force-pushed
the
fix/install-examples-provider-source
branch
from
July 29, 2026 21:52
31e6df8 to
2147de1
Compare
`var.np_api_key` only reached the `np` CLI that the module dependencies shell out to; it never configured the Terraform provider, which falls back to the NULLPLATFORM_API_KEY environment variable. Following the README literally — fill in terraform.tfvars, then `tofu init && tofu apply` — failed to authenticate unless the operator also exported that variable, which the README does not mention. Wires the existing variable into a provider block. No new input: the terraform.tfvars.example already prompts for np_api_key. Note: with provider 0.0.97 `tofu validate` reports a spurious "np_apikey is deprecated" warning for this block even though only `api_key` is set. That is already fixed upstream and will clear on the provider's next release; `api_key` is the correct attribute.
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.
What
Two things stop
specs/install/aws/from working the way the README documents it.1.
tofu initfails. There is norequired_providersblock, so OpenTofu infers the provider source ashashicorp/nullplatform:2.
tofu applydoes not authenticate.var.np_api_keyonly reaches thenpCLI that the module dependencies shell out to; it never configures the Terraform provider, which falls back to theNULLPLATFORM_API_KEYenvironment variable. Following the README literally — fill interraform.tfvars, thentofu init && tofu apply— fails to authenticate unless the operator also exports that variable, which the README does not mention.So the documented install path does not work as written today.
Reproduce
git clone https://github.com/nullplatform/scopes-static-files cd scopes-static-files/static-files/specs/install/aws tofu init -backend=falseThe change
Two files, no new inputs:
versions.tf— declares thenullplatform/nullplatformprovider source, plus a conservativerequired_version = ">= 1.6"floor.provider.tf— aprovider "nullplatform"block wiring the existingvar.np_api_key. Theterraform.tfvars.examplealready prompts for it.No provider version constraint, on purpose. Both
tofu-modulesdependencies already require~> 0.0.86, so a root pin contributes no floor and only risks an unsatisfiable ceiling once the provider moves past 0.1.0. Happy to add one if you would rather the example pin explicitly.Verification
After the change, both commands succeed on the example:
One caveat on the output: with provider 0.0.97
tofu validatereports a spuriousnp_apikey is deprecatedwarning for the new provider block even though onlyapi_keyis set. That is already fixed upstream and will clear on the provider's next release —api_keyis the correct attribute.