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

benchmark

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MPL-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBenchmarkDataSource

func NewBenchmarkDataSource() datasource.DataSource

NewBenchmarkDataSource returns a new instance of BenchmarkDataSource.

func NewBenchmarkListResource

func NewBenchmarkListResource() list.ListResource

NewBenchmarkListResource creates a new list resource for compliance benchmarks.

func NewBenchmarkResource

func NewBenchmarkResource() resource.Resource

NewBenchmarkResource returns a new instance of BenchmarkResource.

Types

type BenchmarkDataSource

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

BenchmarkDataSource implements the Terraform data source for Jamf Compliance Benchmarks.

func (*BenchmarkDataSource) Configure

Configure sets up the API client for the data source from the provider configuration.

func (*BenchmarkDataSource) Metadata

Metadata sets the data source type name for the Terraform provider.

func (*BenchmarkDataSource) Read

Read fetches a benchmark by ID or title and populates the Terraform state.

func (*BenchmarkDataSource) Schema

Schema sets the Terraform schema for the data source.

type BenchmarkDataSourceModel

type BenchmarkDataSourceModel struct {
	ID                  types.String             `tfsdk:"id"`
	Title               types.String             `tfsdk:"title"`
	BenchmarkID         types.String             `tfsdk:"benchmark_id"`
	TenantID            types.String             `tfsdk:"tenant_id"`
	Description         types.String             `tfsdk:"description"`
	Sources             types.List               `tfsdk:"sources"`
	SelectedOsVersions  types.Set                `tfsdk:"selected_os_versions"`
	AvailableOsVersions types.List               `tfsdk:"available_os_versions"`
	Rules               []RuleModel              `tfsdk:"rules"`
	TargetDeviceGroups  types.Set                `tfsdk:"target_device_groups"`
	EnforcementMode     types.String             `tfsdk:"enforcement_mode"`
	Deleted             types.Bool               `tfsdk:"deleted"`
	UpdateAvailable     types.Bool               `tfsdk:"update_available"`
	CanSwitchToEnforce  types.Bool               `tfsdk:"can_switch_to_enforce"`
	LastUpdatedAt       types.String             `tfsdk:"last_updated_at"`
	Timeouts            datasourceTimeouts.Value `tfsdk:"timeouts"`
}

BenchmarkDataSourceModel represents the Terraform data source model for a Jamf Compliance Benchmark.

type BenchmarkListResource

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

BenchmarkListResource implements Terraform list support for compliance benchmarks.

func (*BenchmarkListResource) Configure

Configure wires the provider client into the list resource.

func (*BenchmarkListResource) List

List fetches Jamf Compliance Benchmarks and streams them back to Terraform.

func (*BenchmarkListResource) ListResourceConfigSchema

ListResourceConfigSchema declares the supported filter attributes.

func (*BenchmarkListResource) Metadata

Metadata configures the resource type name for Terraform.

type BenchmarkListResourceModel

type BenchmarkListResourceModel struct {
	Search   types.String       `tfsdk:"search"`
	Timeouts listtimeouts.Value `tfsdk:"timeouts"`
}

BenchmarkListResourceModel represents the config model for benchmark list queries.

type BenchmarkResource

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

BenchmarkResource implements the Terraform resource for Jamf Compliance Benchmark.

func (*BenchmarkResource) Configure

Configure sets up the API client for the resource from the provider configuration.

func (*BenchmarkResource) Create

Create creates a new Jamf Compliance Benchmark resource in Terraform.

Uniqueness: title, enforced (409 DuplicateFieldException), case-insensitive; spaces and accents are significant.

func (*BenchmarkResource) Delete

Delete deletes a Jamf Compliance Benchmark resource from the API and removes it from the Terraform state.

func (*BenchmarkResource) IdentitySchema

IdentitySchema defines the unique identifier for benchmark resources.

func (*BenchmarkResource) ImportState

ImportState handles the import of existing Benchmark resources.

func (*BenchmarkResource) Metadata

Metadata sets the resource type name for the Terraform provider.

func (*BenchmarkResource) ModifyPlan

ModifyPlan reports a title another benchmark already holds, and emits the impact alert for a change to device group targeting.

func (*BenchmarkResource) Read

Read reads the current state of a Jamf Compliance Benchmark resource from the API and updates the Terraform state.

func (*BenchmarkResource) Schema

Schema returns the Terraform schema for the benchmark resource.

func (*BenchmarkResource) Update

Update is not supported for Jamf Compliance Benchmark resources. The resource must be recreated to apply changes.

func (*BenchmarkResource) UpgradeState

func (r *BenchmarkResource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader

UpgradeState migrates v0 state, which could target device groups through either the singular target_device_group or the plural target_device_groups, onto v1, where only the plural survives.

The singular value is folded into the plural set rather than dropped: a user who targeted through the deprecated attribute keeps the same device group after the upgrade, so the removal costs them a config edit and never a re-scope. The upgrader fixes state only — their .tf still has to change, which is what the deprecation window was for.

type BenchmarkResourceModel

type BenchmarkResourceModel struct {
	ID                  types.String           `tfsdk:"id"`
	Title               types.String           `tfsdk:"title"`
	Description         types.String           `tfsdk:"description"`
	SourceBaselineID    types.String           `tfsdk:"source_baseline_id"`
	Sources             types.List             `tfsdk:"sources"`
	SelectedOsVersions  types.Set              `tfsdk:"selected_os_versions"`
	AvailableOsVersions types.List             `tfsdk:"available_os_versions"`
	Rules               []RuleModel            `tfsdk:"rules"`
	TargetDeviceGroups  types.Set              `tfsdk:"target_device_groups"`
	EnforcementMode     types.String           `tfsdk:"enforcement_mode"`
	TenantID            types.String           `tfsdk:"tenant_id"`
	Deleted             types.Bool             `tfsdk:"deleted"`
	UpdateAvailable     types.Bool             `tfsdk:"update_available"`
	CanSwitchToEnforce  types.Bool             `tfsdk:"can_switch_to_enforce"`
	LastUpdatedAt       types.String           `tfsdk:"last_updated_at"`
	Timeouts            resourceTimeouts.Value `tfsdk:"timeouts"`
}

BenchmarkResourceModel represents the Terraform resource model for a Jamf Compliance Benchmark.

type RuleModel

type RuleModel struct {
	ID                      types.String `tfsdk:"id"`
	SectionName             types.String `tfsdk:"section_name"`
	Enabled                 types.Bool   `tfsdk:"enabled"`
	Title                   types.String `tfsdk:"title"`
	Description             types.String `tfsdk:"description"`
	References              types.List   `tfsdk:"references"`
	ODVValue                types.String `tfsdk:"odv_value"`
	ODVHint                 types.String `tfsdk:"odv_hint"`
	ODVPlaceholder          types.String `tfsdk:"odv_placeholder"`
	ODVType                 types.String `tfsdk:"odv_type"`
	ODVValidationMin        types.Int64  `tfsdk:"odv_validation_min"`
	ODVValidationMax        types.Int64  `tfsdk:"odv_validation_max"`
	ODVValidationEnumValues types.List   `tfsdk:"odv_validation_enum_values"`
	ODVValidationRegex      types.String `tfsdk:"odv_validation_regex"`
	SupportedOS             types.List   `tfsdk:"supported_os"`
	OSSpecificDefaults      types.Map    `tfsdk:"os_specific_defaults"`
	DependsOn               types.List   `tfsdk:"depends_on"`
	Reportable              types.Bool   `tfsdk:"reportable"`
	SmartCard               types.Bool   `tfsdk:"smart_card"`
}

RuleModel represents a rule in the benchmark, including ODV and computed fields.

type SourceModel

type SourceModel struct {
	Branch   types.String `tfsdk:"branch"`
	Revision types.String `tfsdk:"revision"`
}

SourceModel represents a source branch and revision for a benchmark.

Jump to

Keyboard shortcuts

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