Documentation
¶
Index ¶
- func NewBenchmarkDataSource() datasource.DataSource
- func NewBenchmarkListResource() list.ListResource
- func NewBenchmarkResource() resource.Resource
- type BenchmarkDataSource
- func (d *BenchmarkDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *BenchmarkDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *BenchmarkDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *BenchmarkDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type BenchmarkDataSourceModel
- type BenchmarkListResource
- func (r *BenchmarkListResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *BenchmarkListResource) List(ctx context.Context, req list.ListRequest, stream *list.ListResultsStream)
- func (r *BenchmarkListResource) ListResourceConfigSchema(ctx context.Context, req list.ListResourceSchemaRequest, ...)
- func (r *BenchmarkListResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- type BenchmarkListResourceModel
- type BenchmarkResource
- func (r *BenchmarkResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *BenchmarkResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *BenchmarkResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *BenchmarkResource) IdentitySchema(ctx context.Context, req resource.IdentitySchemaRequest, ...)
- func (r *BenchmarkResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *BenchmarkResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *BenchmarkResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- func (r *BenchmarkResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *BenchmarkResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *BenchmarkResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- func (r *BenchmarkResource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader
- type BenchmarkResourceModel
- type RuleModel
- type SourceModel
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 ¶
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 ¶
func (d *BenchmarkDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure sets up the API client for the data source from the provider configuration.
func (*BenchmarkDataSource) Metadata ¶
func (d *BenchmarkDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the data source type name for the Terraform provider.
func (*BenchmarkDataSource) Read ¶
func (d *BenchmarkDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read fetches a benchmark by ID or title and populates the Terraform state.
func (*BenchmarkDataSource) Schema ¶
func (d *BenchmarkDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
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 ¶
func (r *BenchmarkListResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure wires the provider client into the list resource.
func (*BenchmarkListResource) List ¶
func (r *BenchmarkListResource) List(ctx context.Context, req list.ListRequest, stream *list.ListResultsStream)
List fetches Jamf Compliance Benchmarks and streams them back to Terraform.
func (*BenchmarkListResource) ListResourceConfigSchema ¶
func (r *BenchmarkListResource) ListResourceConfigSchema(ctx context.Context, req list.ListResourceSchemaRequest, resp *list.ListResourceSchemaResponse)
ListResourceConfigSchema declares the supported filter attributes.
func (*BenchmarkListResource) Metadata ¶
func (r *BenchmarkListResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
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 ¶
func (r *BenchmarkResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure sets up the API client for the resource from the provider configuration.
func (*BenchmarkResource) Create ¶
func (r *BenchmarkResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
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 ¶
func (r *BenchmarkResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete deletes a Jamf Compliance Benchmark resource from the API and removes it from the Terraform state.
func (*BenchmarkResource) IdentitySchema ¶
func (r *BenchmarkResource) IdentitySchema(ctx context.Context, req resource.IdentitySchemaRequest, resp *resource.IdentitySchemaResponse)
IdentitySchema defines the unique identifier for benchmark resources.
func (*BenchmarkResource) ImportState ¶
func (r *BenchmarkResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState handles the import of existing Benchmark resources.
func (*BenchmarkResource) Metadata ¶
func (r *BenchmarkResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata sets the resource type name for the Terraform provider.
func (*BenchmarkResource) ModifyPlan ¶
func (r *BenchmarkResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan reports a title another benchmark already holds, and emits the impact alert for a change to device group targeting.
func (*BenchmarkResource) Read ¶
func (r *BenchmarkResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read reads the current state of a Jamf Compliance Benchmark resource from the API and updates the Terraform state.
func (*BenchmarkResource) Schema ¶
func (r *BenchmarkResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
Schema returns the Terraform schema for the benchmark resource.
func (*BenchmarkResource) Update ¶
func (r *BenchmarkResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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.