terraform-provider-jamfpro icon indicating copy to clipboard operation
terraform-provider-jamfpro copied to clipboard

Error when creating basic Policy

Open smithjw opened this issue 11 months ago • 1 comments

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 {
    }
  }
}

smithjw avatar Mar 20 '24 06:03 smithjw

We're making good progress on this and we are hoping to having something ready for testing with release v0.0.51.

ShocOne avatar Apr 24 '24 08:04 ShocOne

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.

ShocOne avatar May 20 '24 20:05 ShocOne

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.

ShocOne avatar May 21 '24 16:05 ShocOne