provider

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2026 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package provider implements the Hyper-V Terraform provider.

At this point only the Provider type and its schema/Configure flow are defined. Resources and data sources land in subsequent commits per docs/PLAN.md §12 M1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string) func() provider.Provider

New returns a provider factory suitable for providerserver.Serve.

Types

type HypervProvider

type HypervProvider struct {
	// contains filtered or unexported fields
}

HypervProvider is the root provider type. Each terraform plan/apply gets its own instance via the closure returned by New.

func (*HypervProvider) Configure

func (*HypervProvider) DataSources

func (p *HypervProvider) DataSources(_ context.Context) []func() datasource.DataSource

func (*HypervProvider) Metadata

func (*HypervProvider) Resources

func (p *HypervProvider) Resources(_ context.Context) []func() resource.Resource

func (*HypervProvider) Schema

type HypervProviderModel

type HypervProviderModel struct {
	Backend  types.String `tfsdk:"backend"`
	Host     types.String `tfsdk:"host"`
	Port     types.Int64  `tfsdk:"port"`
	Username types.String `tfsdk:"username"`
	Password types.String `tfsdk:"password"`
	Timeout  types.String `tfsdk:"timeout"`

	Local *LocalConfig `tfsdk:"local"`
	SSH   *SSHConfig   `tfsdk:"ssh"`
	WinRM *WinRMConfig `tfsdk:"winrm"`
}

HypervProviderModel mirrors the provider schema. All fields are typed framework values so we can distinguish unset, explicitly-null, and configured. See docs/PLAN.md §6 for the env-var precedence rules (provider attribute > env var > zero/error).

type LocalConfig

type LocalConfig struct {
	PwshPath types.String `tfsdk:"pwsh_path"`
}

LocalConfig configures the local backend (provider runs on the Hyper-V host itself). All fields optional; env-var fallbacks apply.

type SSHConfig

type SSHConfig struct {
	PrivateKey     types.String `tfsdk:"private_key"`
	PrivateKeyPath types.String `tfsdk:"private_key_path"`
	Passphrase     types.String `tfsdk:"passphrase"`
	KnownHostsPath types.String `tfsdk:"known_hosts_path"`
}

SSHConfig configures the SSH backend. Attribute names locked per S13; resolved into connection.SSHOptions by newSSHConnection.

type WinRMConfig

type WinRMConfig struct {
	UseHTTPS types.Bool   `tfsdk:"use_https"`
	Insecure types.Bool   `tfsdk:"insecure"`
	Auth     types.String `tfsdk:"auth"`
	CACert   types.String `tfsdk:"cacert"`
}

WinRMConfig configures the WinRM backend. Schema is defined now to lock the attribute names per §13; the backend itself ships in M3.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL