Help us shape the future of Go! Take the 2026 Go Developer Survey

importgen

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Quiet bool

Quiet suppresses progress messages.

Functions

func Finalize

func Finalize(outputDir string, creds *Credentials) error

Finalize writes the user-facing provider.tf (with var.* references), variables.tf, and terraform.tfvars into the output directory. Call this after terraform plan/query has completed.

func FinalizePlatform

func FinalizePlatform(outputDir string, creds *PlatformCredentials) error

FinalizePlatform rewrites provider.tf with var.* references and writes variables.tf and terraform.tfvars. Call after terraform plan/query.

func FinalizeProtect

func FinalizeProtect(outputDir string, creds *ProtectCredentials) error

FinalizeProtect rewrites provider.tf with var.* references and writes variables.tf and terraform.tfvars. Call after terraform plan/query.

func Generate

func Generate(outputDir string, creds *Credentials, resources *discovery.Results) error

Generate writes the provider.tf, variables.tf, terraform.tfvars, and per-type import files into the output directory.

func GenerateJSC

func GenerateJSC(outputDir string, creds *JSCCredentials) error

GenerateJSC writes the provider.tf, variables.tf, and terraform.tfvars for a JSC project into the output directory.

func GeneratePlatform

func GeneratePlatform(outputDir string, creds *PlatformCredentials) error

GeneratePlatform writes a minimal provider.tf (required_providers only) for a Jamf Platform project. The provider configures itself from env vars during terraform plan/query. Call FinalizePlatform after terraform completes.

func GenerateProtect

func GenerateProtect(outputDir string, creds *ProtectCredentials) error

GenerateProtect writes a minimal provider.tf (required_providers only) for a Jamf Protect project. The provider configures itself from env vars during terraform plan/query. Call FinalizeProtect after terraform completes.

func WriteGitignore

func WriteGitignore(outputDir string) error

WriteGitignore writes a .gitignore to the output directory to prevent accidentally committing secrets, state, and terraform internals. Skips writing if the file already exists.

Types

type Credentials

type Credentials struct {
	URL                      string
	AuthMethod               string // "basic" or "oauth2"
	Username                 string // basic auth
	Password                 string // basic auth
	ClientID                 string // oauth2
	ClientSecret             string // oauth2
	ProviderVersion          string // user-specified exact pin (empty = use latest)
	ResolvedVersion          string // version resolved by terraform init (for >= constraint)
	TokenRefreshBufferPeriod int    // oauth2: dynamically determined buffer period in seconds (0 = use provider default)
}

Credentials holds the Jamf Pro auth details for generating tfvars.

type JSCCredentials

type JSCCredentials struct {
	URL             string // radar.wandera.com or custom domain
	Username        string
	Password        string
	ProviderVersion string // user-specified exact pin (empty = use latest)
	ResolvedVersion string // version resolved by terraform init (for >= constraint)
}

JSCCredentials holds JSC (Jamf Security Cloud) auth details for generating tfvars.

type PlatformCredentials

type PlatformCredentials struct {
	BaseURL         string
	ClientID        string
	ClientSecret    string
	EnvironmentID   string // preferred scope; written as environment_id
	TenantID        string // legacy scope; written as tenant_id
	ProviderVersion string // user-specified exact pin (empty = use latest)
	ResolvedVersion string // version resolved by terraform init (for >= constraint)
}

PlatformCredentials holds Jamf Platform auth details for generating tfvars.

EnvironmentID and TenantID are mutually exclusive: an API integration targets one or the other, and the provider rejects both together with a "Conflicting API Integration Scope" error. Both empty is organization scope, where the gateway resolves the organization from the access token and neither attribute is written at all — that is how the provider itself selects it, so an empty attribute must be omitted rather than emitted as "".

type ProtectCredentials

type ProtectCredentials struct {
	URL             string
	ClientID        string
	ClientSecret    string
	ProviderVersion string // user-specified exact pin (empty = use latest)
	ResolvedVersion string // version resolved by terraform init (for >= constraint)
}

ProtectCredentials holds Jamf Protect auth details for generating tfvars.

Jump to

Keyboard shortcuts

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