deploymenttheory / terraform-provider-jamfpro

Jamf Pro Terraform Provider/Plugin written with the TF Provider SDK v2. Written in go
Mozilla Public License 2.0
26 stars 9 forks source link

Error when creating basic Policy #143

Closed smithjw closed 3 months ago

smithjw commented 5 months ago

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 {
    }
  }
}
ShocOne commented 4 months ago

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

ShocOne commented 3 months ago

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 commented 3 months ago

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.