Files
llmgw/terraform-provider-llmgw/main.go
T
Ilker ManapandClaude Opus 5.5 11b5d44702 A Terraform provider for llmgw: models, quotas and guard attachments through the admin API
terraform-provider-llmgw/ is a module of its own, built on
terraform-plugin-framework, so the gateway does not carry its dependencies.
llmgw_model is a model added at runtime: scaling, class, owner and adapters
change in place, anything else replaces it; the definition is kept as
written rather than as the catalog filled it in. llmgw_quota and
llmgw_guard_attachment keep the scope as written beside the ID it resolved
to, and import by that ID. Data sources llmgw_models and llmgw_nodes.

The client lists every endpoint it calls and refuses any other; a test
checks each, and every field it sends and reads, against
docs/admin-api.openapi.json, so a change to the admin API that breaks the
provider fails here. Acceptance tests run Terraform against an admin API in
memory when TF_ACC is set. CI vets and tests the module.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 00:04:35 +02:00

39 lines
1.0 KiB
Go

// Command terraform-provider-llmgw is the llmgw Terraform provider: models,
// capacity quotas and guardrail attachments managed through a control
// plane's admin API.
//
// A module of its own, so the gateway's binary does not carry Terraform's
// dependencies.
package main
import (
"context"
"flag"
"log"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
"gitea.mynodes.xyz/ilker/llmgw/terraform-provider-llmgw/internal/provider"
)
// version is set when a release is built: -ldflags "-X main.version=v0.1.0".
var version = "dev"
// Address is the provider's source address, as a configuration's
// required_providers names it.
const Address = "gitea.mynodes.xyz/ilker/llmgw"
func main() {
var debug bool
flag.BoolVar(&debug, "debug", false, "run under a debugger, printing what TF_REATTACH_PROVIDERS needs")
flag.Parse()
err := providerserver.Serve(context.Background(), provider.New(version), providerserver.ServeOpts{
Address: Address,
Debug: debug,
})
if err != nil {
log.Fatal(err)
}
}