deploymenttheory / terraform-provider-jamfpro

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

Issue: possible bug in jamfpro_computer_prestage_enrollment ? #462

Open ecanault opened 1 day ago

ecanault commented 1 day ago

Hi,

If I create from scratch a jamfpro_computer_prestage_enrollment resource containing an Enrollment Packages configuration I encounter this error:

│ Error: failed to create Jamf Pro Computer Prestage Enrollment 'PreStage COMPANY' after retries: failed to create computer prestage, error: {"status_code":400,"method":"POST","url":"https://devnetopie.jamfcloud.com/api/v3/computer-prestages","message":"API Error Response","raw_response":""}
│ 
│   with module.prestages["9D0BDA59-6BCB-443F-8F07-60B61E56B008"].jamfpro_computer_prestage_enrollment.object,
│   on terraform_modules/prestages/resource_jamfpro_prestages.tf line 1, in resource "jamfpro_computer_prestage_enrollment" "object":
│    1: resource "jamfpro_computer_prestage_enrollment" "object" {

For information, there is no error before the plan is applied:

  # module.prestages["9D0BDA59-6BCB-443F-8F07-60B61E56B008"].jamfpro_computer_prestage_enrollment.object will be created
  + resource "jamfpro_computer_prestage_enrollment" "object" {
      + anchor_certificates                     = []
      + auto_advance_setup                      = false
      + custom_package_distribution_point_id    = "-2"
      + custom_package_ids                      = [
          + "146",
        ]
      + default_prestage                        = true
      ...

But if I create the PreStage without the Enrollment Packages configuration: it works.

More strangely, if I add after the Enrollment Package configuration: then it works also.

  # module.prestages["9D0BDA59-6BCB-443F-8F07-60B61E56B008"].jamfpro_computer_prestage_enrollment.object will be updated in-place
  ~ resource "jamfpro_computer_prestage_enrollment" "object" {
      ~ custom_package_distribution_point_id    = "-1" -> "-2"
      ~ custom_package_ids                      = [
          + "146",
        ]
        id                                      = "14"
        # (26 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

Thanks, Emmanuel