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 ¶
- func New(version string) func() provider.Provider
- type HypervProvider
- func (p *HypervProvider) Configure(ctx context.Context, req provider.ConfigureRequest, ...)
- func (p *HypervProvider) DataSources(_ context.Context) []func() datasource.DataSource
- func (p *HypervProvider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse)
- func (p *HypervProvider) Resources(_ context.Context) []func() resource.Resource
- func (p *HypervProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse)
- type HypervProviderModel
- type LocalConfig
- type SSHConfig
- type WinRMConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (p *HypervProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse)
func (*HypervProvider) DataSources ¶
func (p *HypervProvider) DataSources(_ context.Context) []func() datasource.DataSource
func (*HypervProvider) Metadata ¶
func (p *HypervProvider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse)
func (*HypervProvider) Resources ¶
func (p *HypervProvider) Resources(_ context.Context) []func() resource.Resource
func (*HypervProvider) Schema ¶
func (p *HypervProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse)
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 ¶
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.