terraform-provider-jamfpro
terraform-provider-jamfpro copied to clipboard
Error when creating basic Policy
Receiving the following error when trying to create a Jamf Policy
Error: Invalid address to set: []string{"self_service", "0", "self_service_categories", "0", "id"}
│
│ with jamfpro_policy.enrolment,
│ on policy_enrolment.tf line 1, in resource "jamfpro_policy" "enrolment":
│ 1: resource "jamfpro_policy" "enrolment" {
Here is the tf block that's showing as valid in VS code and successfully produces a plan
resource "jamfpro_policy" "enrolment" {
general {
enabled = true
name = "01 - Enrolment"
trigger = "EVENT"
category {
id = resource.jamfpro_category.this["_Enrolment"].id
}
frequency = "Ongoing"
trigger_other = "configure-Mac"
override_default_settings {}
site {}
}
scripts {
script {
id = module.jamfpro_scripts_enrolment["enrolment"].script_id
}
}
scope { all_computers = true }
self_service {
self_service_icon {
}
}
}
We're making good progress on this and we are hoping to having something ready for testing with release v0.0.51.
Quick update to say that in main we have a working alpha now for policies. It's not part of a release, but can be compiled and tested if you're interested.
Will close this out as of the release of v0.0.54 and await feedback for specific issues with the resource type. There's been significant changes since this ticket was originally raised and so it's no longer representative compared to the current code base.