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

jsc

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Quiet bool

Quiet suppresses progress messages.

View Source
var Resources = []ResourceDef{
	{
		FilterKey:      "activation_profiles",
		DisplayName:    "Activation Profiles",
		TFType:         "jsc_ap",
		OutputFile:     "activation_profiles.tf",
		DataSource:     "jsc_activation_profiles",
		DataSourceAttr: "profiles",
	},
	{
		FilterKey:      "entra_idps",
		DisplayName:    "Entra IdP Connections",
		TFType:         "jsc_entra_idp",
		OutputFile:     "entra_idps.tf",
		DataSource:     "jsc_entra_idps",
		DataSourceAttr: "connections",
	},
	{
		FilterKey:      "hostname_mappings",
		DisplayName:    "Hostname Mappings",
		TFType:         "jsc_hostnamemapping",
		OutputFile:     "hostname_mappings.tf",
		DataSource:     "jsc_hostnamemappings",
		DataSourceAttr: "mappings",
	},
	{
		FilterKey:      "access_policies",
		DisplayName:    "Access Policies",
		TFType:         "jsc_access_policy",
		OutputFile:     "access_policies.tf",
		DataSource:     "jsc_access_policies",
		DataSourceAttr: "policies",
	},
	{
		FilterKey:   "secure_policy",
		DisplayName: "Secure Policy (singleton)",
		TFType:      "jsc_secure_policy",
		OutputFile:  "secure_policy.tf",
		IsSingleton: true,
		SingletonID: "secure_policy",
	},
}

Resources is the ordered list of all supported JSC resource types.

Functions

func DefaultRules

func DefaultRules() []postprocess.ReferenceRule

DefaultRules returns the reference rules for JSC resource types.

func RunPipeline

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

RunPipeline executes the full JSC export pipeline: generate provider config → discover resources → generate imports → 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.

func ValidFilterNames

func ValidFilterNames() map[string]string

ValidFilterNames returns a map of user-friendly filter names → canonical keys.

Types

type DiscoveredResource

type DiscoveredResource struct {
	ID    string
	Name  string
	Label string
}

DiscoveredResource represents a resource discovered via data source.

type DiscoveryResults

type DiscoveryResults struct {
	ActivationProfiles []DiscoveredResource
	EntraIdps          []DiscoveredResource
	HostnameMappings   []DiscoveredResource
	AccessPolicies     []DiscoveredResource
}

DiscoveryResults holds all discovered resources by type.

type PipelineOptions

type PipelineOptions struct {
	OutputDir         string
	URL               string // radar.wandera.com or custom domain
	Username          string
	Password          string
	SelectedResources map[string]bool
	SkipReferences    bool
	ProviderVersion   string
	Quiet             bool
	Verbose           bool
	StatusFunc        func(string, int, int) // optional callback: (message, current, total)
}

PipelineOptions holds all parameters needed to run the JSC 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
	DataSource     string // data source type for discovery (empty for singletons)
	DataSourceAttr string // attribute in data source containing the list
	IsSingleton    bool   // true if this is a singleton resource
	SingletonID    string // import ID for singletons
}

ResourceDef describes a single JSC resource type.

func DiscoverableResources

func DiscoverableResources() []ResourceDef

DiscoverableResources returns only resources that have data sources for discovery.

func SingletonResources

func SingletonResources() []ResourceDef

SingletonResources returns only singleton resources.

Jump to

Keyboard shortcuts

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