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

pro

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Resources = []ResourceDef{
	{FilterKey: "sites", DisplayName: "Sites", TFType: "jamfpro_site", OutputFile: "sites.tf"},
	{FilterKey: "buildings", DisplayName: "Buildings", TFType: "jamfpro_building", OutputFile: "buildings.tf"},
	{FilterKey: "categories", DisplayName: "Categories", TFType: "jamfpro_category", OutputFile: "categories.tf"},
	{FilterKey: "departments", DisplayName: "Departments", TFType: "jamfpro_department", OutputFile: "departments.tf"},
	{FilterKey: "scripts", DisplayName: "Scripts", TFType: "jamfpro_script", OutputFile: "scripts.tf"},
	{FilterKey: "extension_attributes", DisplayName: "Computer Extension Attributes", TFType: "jamfpro_computer_extension_attribute", OutputFile: "computer_extension_attributes.tf"},
	{FilterKey: "packages", DisplayName: "Packages", TFType: "jamfpro_package", OutputFile: "packages.tf"},
	{FilterKey: "dock_items", DisplayName: "Dock Items", TFType: "jamfpro_dock_item", OutputFile: "dock_items.tf"},
	{FilterKey: "printers", DisplayName: "Printers", TFType: "jamfpro_printer", OutputFile: "printers.tf"},
	{FilterKey: "network_segments", DisplayName: "Network Segments", TFType: "jamfpro_network_segment", OutputFile: "network_segments.tf"},
	{FilterKey: "smart_computer_groups", DisplayName: "Smart Computer Groups", TFType: "jamfpro_smart_computer_group_v2", OutputFile: "smart_computer_groups.tf"},
	{FilterKey: "static_computer_groups", DisplayName: "Static Computer Groups", TFType: "jamfpro_static_computer_group", OutputFile: "static_computer_groups.tf"},
	{FilterKey: "macos_configuration_profiles", DisplayName: "macOS Configuration Profiles", TFType: "jamfpro_macos_configuration_profile_plist", OutputFile: "macos_configuration_profiles.tf"},
	{FilterKey: "policies", DisplayName: "Policies", TFType: "jamfpro_policy", OutputFile: "policies.tf"},
	{FilterKey: "icons", DisplayName: "Icons", TFType: "jamfpro_icon", OutputFile: "icons.tf"},
	{FilterKey: "enrollment_customizations", DisplayName: "Enrollment Customizations", TFType: "jamfpro_enrollment_customization", OutputFile: "enrollment_customizations.tf"},
	{FilterKey: "computer_prestages", DisplayName: "Computer Prestages", TFType: "jamfpro_computer_prestage_enrollment", OutputFile: "computer_prestages.tf"},
	{FilterKey: "advanced_computer_searches", DisplayName: "Advanced Computer Searches", TFType: "jamfpro_advanced_computer_search", OutputFile: "advanced_computer_searches.tf"},
	{FilterKey: "app_installers", DisplayName: "App Installers", TFType: "jamfpro_app_installer", OutputFile: "app_installers.tf"},
	{FilterKey: "mac_applications", DisplayName: "Mac Applications", TFType: "jamfpro_mac_application", OutputFile: "mac_applications.tf"},
	{FilterKey: "device_enrollments", DisplayName: "Device Enrollments (ADE)", TFType: "jamfpro_device_enrollments", OutputFile: "device_enrollments.tf"},
	{FilterKey: "volume_purchasing_locations", DisplayName: "Volume Purchasing Locations (VPP)", TFType: "jamfpro_volume_purchasing_locations", OutputFile: "volume_purchasing_locations.tf"},
	{FilterKey: "restricted_software", DisplayName: "Restricted Software", TFType: "jamfpro_restricted_software", OutputFile: "restricted_software.tf"},
	{FilterKey: "smart_mobile_device_groups", DisplayName: "Smart Mobile Device Groups", TFType: "jamfpro_smart_mobile_device_group_v1", OutputFile: "smart_mobile_device_groups.tf"},
	{FilterKey: "static_mobile_device_groups", DisplayName: "Static Mobile Device Groups", TFType: "jamfpro_static_mobile_device_group", OutputFile: "static_mobile_device_groups.tf"},
	{FilterKey: "mobile_device_configuration_profiles", DisplayName: "Mobile Device Configuration Profiles", TFType: "jamfpro_mobile_device_configuration_profile_plist", OutputFile: "mobile_device_configuration_profiles.tf"},
	{FilterKey: "mobile_device_prestages", DisplayName: "Mobile Device Prestages", TFType: "jamfpro_mobile_device_prestage_enrollment", OutputFile: "mobile_device_prestages.tf"},
	{FilterKey: "mobile_device_extension_attributes", DisplayName: "Mobile Device Extension Attributes", TFType: "jamfpro_mobile_device_extension_attribute", OutputFile: "mobile_device_extension_attributes.tf"},
	{FilterKey: "advanced_mobile_device_searches", DisplayName: "Advanced Mobile Device Searches", TFType: "jamfpro_advanced_mobile_device_search", OutputFile: "advanced_mobile_device_searches.tf"},
	{FilterKey: "api_integrations", DisplayName: "API Integrations", TFType: "jamfpro_api_integration", OutputFile: "api_integrations.tf"},
	{FilterKey: "api_roles", DisplayName: "API Roles", TFType: "jamfpro_api_role", OutputFile: "api_roles.tf"},
	{FilterKey: "accounts", DisplayName: "Accounts", TFType: "jamfpro_account", OutputFile: "accounts.tf"},
	{FilterKey: "webhooks", DisplayName: "Webhooks", TFType: "jamfpro_webhook", OutputFile: "webhooks.tf"},
	{FilterKey: "account_groups", DisplayName: "Account Groups", TFType: "jamfpro_account_group", OutputFile: "account_groups.tf"},
	{FilterKey: "disk_encryption_configurations", DisplayName: "Disk Encryption Configurations", TFType: "jamfpro_disk_encryption_configuration", OutputFile: "disk_encryption_configurations.tf"},
	{FilterKey: "allowed_file_extensions", DisplayName: "Allowed File Extensions", TFType: "jamfpro_allowed_file_extension", OutputFile: "allowed_file_extensions.tf"},
	{FilterKey: "ldap_servers", DisplayName: "LDAP Servers", TFType: "jamfpro_ldap_server", OutputFile: "ldap_servers.tf"},
	{FilterKey: "mobile_device_applications", DisplayName: "Mobile Device Applications", TFType: "jamfpro_mobile_device_application", OutputFile: "mobile_device_applications.tf"},
	{FilterKey: "user_groups", DisplayName: "User Groups", TFType: "jamfpro_user_group", OutputFile: "user_groups.tf"},
	{FilterKey: "self_service_branding_macos", DisplayName: "Self Service Branding (macOS)", TFType: "jamfpro_self_service_branding_macos", OutputFile: "self_service_branding_macos.tf"},
	{FilterKey: "self_service_branding_ios", DisplayName: "Self Service Branding (iOS)", TFType: "jamfpro_self_service_branding_ios", OutputFile: "self_service_branding_ios.tf"},
	{FilterKey: "advanced_user_searches", DisplayName: "Advanced User Searches", TFType: "jamfpro_advanced_user_search", OutputFile: "advanced_user_searches.tf"},

	{FilterKey: "smtp_server", DisplayName: "SMTP Server", TFType: "jamfpro_smtp_server", OutputFile: "smtp_server.tf", IsSingleton: true, SingletonImportID: "jamfpro_smtp_server_singleton"},
	{FilterKey: "activation_code", DisplayName: "Activation Code", TFType: "jamfpro_activation_code", OutputFile: "activation_code.tf", IsSingleton: true, SingletonImportID: "jamfpro_activation_code_singleton"},
	{FilterKey: "client_checkin", DisplayName: "Client Check-In", TFType: "jamfpro_client_checkin", OutputFile: "client_checkin.tf", IsSingleton: true, SingletonImportID: "jamfpro_client_checkin_singleton"},
	{FilterKey: "cloud_distribution_point", DisplayName: "Cloud Distribution Point", TFType: "jamfpro_cloud_distribution_point", OutputFile: "cloud_distribution_point.tf", IsSingleton: true, SingletonImportID: "jamfpro_cloud_distribution_point_singleton"},
	{FilterKey: "reenrollment", DisplayName: "Re-enrollment", TFType: "jamfpro_reenrollment", OutputFile: "reenrollment.tf", IsSingleton: true, SingletonImportID: "jamfpro_reenrollment_settings_singleton"},

	{FilterKey: "computer_inventory_collection_settings", DisplayName: "Computer Inventory Collection Settings", TFType: "jamfpro_computer_inventory_collection_settings", OutputFile: "computer_inventory_collection_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_computer_inventory_collection_settings_singleton"},
	{FilterKey: "access_management_settings", DisplayName: "Access Management Settings", TFType: "jamfpro_access_management_settings", OutputFile: "access_management_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_access_management_settings_singleton"},
	{FilterKey: "account_driven_user_enrollment_settings", DisplayName: "Account-Driven User Enrollment Settings", TFType: "jamfpro_account_driven_user_enrollment_settings", OutputFile: "account_driven_user_enrollment_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_account_driven_user_enrollment_settings_singleton"},
	{FilterKey: "app_installer_global_settings", DisplayName: "App Installer Global Settings", TFType: "jamfpro_app_installer_global_settings", OutputFile: "app_installer_global_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_app_installers_global_settings_singleton"},
	{FilterKey: "device_communication_settings", DisplayName: "Device Communication Settings", TFType: "jamfpro_device_communication_settings", OutputFile: "device_communication_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_device_communication_settings_singleton"},
	{FilterKey: "engage_settings", DisplayName: "Engage Settings", TFType: "jamfpro_engage_settings", OutputFile: "engage_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_engage_settings_singleton"},
	{FilterKey: "impact_alert_notification_settings", DisplayName: "Impact Alert Notification Settings", TFType: "jamfpro_impact_alert_notification_settings", OutputFile: "impact_alert_notification_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_impact_alert_notification_settings_singleton"},

	{FilterKey: "managed_software_update_feature_toggle", DisplayName: "Managed Software Update Feature Toggle", TFType: "jamfpro_managed_software_update_feature_toggle", OutputFile: "managed_software_update_feature_toggle.tf", IsSingleton: true, SingletonImportID: "jamfpro_managed_software_update_feature_toggle_singleton"},
	{FilterKey: "self_service_plus_settings", DisplayName: "Self Service+ Settings", TFType: "jamfpro_self_service_plus_settings", OutputFile: "self_service_plus_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_self_service_plus_settings_singleton"},
	{FilterKey: "self_service_settings", DisplayName: "Self Service Settings", TFType: "jamfpro_self_service_settings", OutputFile: "self_service_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_self_service_settings_singleton"},
	{FilterKey: "service_discovery_enrollment_well_known_settings", DisplayName: "Service Discovery Enrollment Settings", TFType: "jamfpro_service_discovery_enrollment_well_known_settings", OutputFile: "service_discovery_enrollment_well_known_settings.tf", IsSingleton: true, SingletonImportID: "jamfpro_service_discovery_enrollment_well_known_settings_singleton"},
}

Resources is the ordered list of all supported Jamf Pro resource types. Order matches the dependency/discovery order used by the pipeline.

Functions

func DefaultRules

func DefaultRules() []postprocess.ReferenceRule

DefaultRules returns the reference rules for Jamf Pro resource types.

func RunPipeline

func RunPipeline(opts *PipelineOptions) (*postprocess.FixResult, error)

RunPipeline executes the full Jamf Pro export pipeline: authenticate → discover → download → import gen → terraform plan → post-process. Returns the validation fix result (may be nil) and any fatal error.

func TypeToFileMap

func TypeToFileMap() map[string]string

TypeToFileMap returns a map of TF resource type → output filename, derived from the Resources table.

func ValidFilterNames

func ValidFilterNames() map[string]string

ValidFilterNames returns a map of user-friendly filter names → canonical keys. Includes aliases (e.g. "computer_extension_attributes" → "extension_attributes").

Types

type IntermediateResult

type IntermediateResult struct {
	Registry        *registry.Registry
	Resources       *discovery.Results
	GeneratedFile   string            // path to generated.tf
	OutputDir       string            // working directory
	PackageFiles    map[string]string // filename → relative path
	PackageInfo     map[string]string // package_name → filename
	IconURLs        map[string]string // icon jamf ID → CDN URL
	ECImageFiles    map[string]string // enrollment customization jamf ID → relative path
	ImportCreds     *importgen.Credentials
	ProviderSchemas any // *tfjson.ProviderSchemas (kept as interface to avoid import in callers)
}

IntermediateResult holds the output of RunDiscoveryAndGenerate — everything needed to either run the standard single-env postprocessing or feed into the multi-env merge pipeline.

func RunDiscoveryAndGenerate

func RunDiscoveryAndGenerate(opts *PipelineOptions) (*IntermediateResult, error)

RunDiscoveryAndGenerate executes steps 1–6 of the Jamf Pro pipeline (authenticate → discover → download → import gen → terraform init → terraform plan) and returns the intermediate results without postprocessing. This is used by both the single-env RunPipeline and the multi-env merge pipeline.

type PipelineOptions

type PipelineOptions struct {
	OutputDir            string
	URL                  string
	AuthMethod           string
	Username             string
	Password             string
	ClientID             string
	ClientSecret         string
	SelectedResources    map[string]bool
	SkipReferences       bool
	SplitByCategory      bool
	SkipPackageDownloads bool
	ProviderVersion      string
	Quiet                bool
	Verbose              bool
	ResourcesFlag        string                 // original -include-resources value (for log message)
	ExcludeFlag          string                 // original -exclude-resources value (for log message)
	StatusFunc           func(string, int, int) // optional callback: (message, current, total)
}

PipelineOptions holds all parameters needed to run the Jamf Pro pipeline.

type ResourceDef

type ResourceDef struct {
	FilterKey         string // key for -include-resources / -exclude-resources
	DisplayName       string // human-readable name for prompts and output
	TFType            string // Terraform resource type name
	OutputFile        string // filename in the output directory
	IsSingleton       bool   // true for settings resources with no list API (exactly one instance)
	SingletonImportID string // fixed import ID for singleton resources (e.g. "jamfpro_smtp_server_singleton")
}

ResourceDef describes a single Jamf Pro resource type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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