Skip to content

fix: declare the nullplatform provider source in the install example - #19

Merged
jcastiarena merged 2 commits into
mainfrom
fix/install-examples-provider-source
Sep 8, 2026
Merged

fix: declare the nullplatform provider source in the install example#19
jcastiarena merged 2 commits into
mainfrom
fix/install-examples-provider-source

Conversation

@jcastiarena

@jcastiarena jcastiarena commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What

Two things stop specs/install/aws/ from working the way the README documents it.

1. tofu init fails. There is no required_providers block, so OpenTofu infers the provider source as hashicorp/nullplatform:

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider
hashicorp/nullplatform: provider registry registry.opentofu.org does not have
a provider named registry.opentofu.org/hashicorp/nullplatform

Did you intend to use nullplatform/nullplatform? If so, you must specify that
source address in each module which requires that provider.

2. tofu apply does not authenticate. var.np_api_key only reaches the np CLI that the module dependencies shell out to; it never configures 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 — 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=false

The change

Two files, no new inputs:

  • versions.tf — declares the nullplatform/nullplatform provider source, plus a conservative required_version = ">= 1.6" floor.
  • provider.tf — a provider "nullplatform" block wiring the existing var.np_api_key. The terraform.tfvars.example already prompts for it.

No provider version constraint, 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. Happy to add one if you would rather the example pin explicitly.

Verification

After the change, both commands succeed on the example:

tofu init -backend=false   → OpenTofu has been successfully initialized!
tofu validate              → Success! The configuration is valid.

One caveat on the output: with provider 0.0.97 tofu validate reports a spurious np_apikey is deprecated warning for the new provider 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.

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
jcastiarena force-pushed the fix/install-examples-provider-source branch from 31e6df8 to 2147de1 Compare July 29, 2026 21:52
`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.

@sebastiancorrea81 sebastiancorrea81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@jcastiarena
jcastiarena merged commit ed22cc1 into main Sep 8, 2026
5 checks passed
@jcastiarena
jcastiarena deleted the fix/install-examples-provider-source branch September 8, 2026 15:46
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