Plenty of writes now works and an expanded example exists in the terraform directory

This commit is contained in:
Joachim Friberg committed 2026-08-25 20:25:08 +02:00
1 parent a6f1019175
commit fb8d468943
15 files changed
+1344 -74

No files matched your search

+8 -1
View File
@@ -4,6 +4,7 @@ import (
"context"
"log"
tfprovider "github.com/hashicorp/terraform-plugin-framework/provider"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
"terraform-provider-hpe1810/internal/provider"
@@ -15,12 +16,18 @@ import (
var version = "dev"
func main() {
err := providerserver.Serve(context.Background(), provider.New(version), providerserver.ServeOpts{
p := provider.New(version)
err := providerserver.Serve(context.Background(), func() tfprovider.Provider { return p }, providerserver.ServeOpts{
// Only meaningful once/if this is ever published; for local
// development with dev_overrides (~/.tofurc) this address just
// needs to match what's referenced there.
Address: "local/joachimfriberg/hpe1810",
})
// Best-effort: optionally save the running config (if save_running_config=true
// and something actually changed this run), then always free up the switch's
// one session slot so the next `tofu` invocation doesn't have to wait out the
// switch's own session timeout.
p.Shutdown()
if err != nil {
log.Fatal(err.Error())
}