Skip to content

feat(service-definition): add local filesystem provider#278

Merged
agustincelentano merged 1 commit intomainfrom
feat/service-definition-local-provider
Apr 5, 2026
Merged

feat(service-definition): add local filesystem provider#278
agustincelentano merged 1 commit intomainfrom
feat/service-definition-local-provider

Conversation

@agustincelentano
Copy link
Copy Markdown
Collaborator

Summary

  • Add git_provider = "local" option to the service_definition module that reads specs from the local filesystem using file() instead of HTTP
  • New variable local_specs_path points to the directory containing specs/service-spec.json.tpl and specs/links/*.json.tpl
  • HTTP data sources are skipped when using local mode (count = 0 / for_each = toset([]))

This enables fast iterative development of service specs without needing to push to a remote repository first.

Usage

module "service_definition_my_service" {
  source = "github.com/nullplatform/tofu-modules//nullplatform/service_definition"

  nrn          = var.nrn
  service_name = "My Service"
  service_path = "services/my-service"

  git_provider     = "local"
  local_specs_path = "${path.root}/../services/my-service"

  available_links = ["connect"]
}

Test plan

  • Tested with a real S3 bucket service: tofu init + tofu plan + tofu apply successfully created service_specification and link_specification from local specs
  • Verify existing github and gitlab providers still work unchanged
  • Verify tofu validate passes with git_provider = "local"

Add git_provider = "local" option that reads service specs directly from the
local filesystem using file() instead of HTTP requests. This enables fast
iterative development without pushing specs to a remote repository.

Changes:
- variables.tf: add "local" to git_provider validation, add local_specs_path variable
- data.tf: skip HTTP data sources when git_provider = "local" (count=0, for_each=toset([]))
- locals.tf: branch spec parsing between file() and data.http based on git_provider
@agustincelentano agustincelentano merged commit f24d7c9 into main Apr 5, 2026
42 checks passed
@agustincelentano agustincelentano deleted the feat/service-definition-local-provider branch April 5, 2026 16:03
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.

1 participant