jfrog / terraform-provider-xray

Terraform provider to manage JFrog Xray
https://jfrog.com/xray/
Apache License 2.0
151 stars 12 forks source link

error message for incorrect policy type is not helpful #97

Closed RobertBlumen closed 1 year ago

RobertBlumen commented 1 year ago

Describe the bug

Requirements for and issue

resource "xray_operational_risk_policy" "op_risk" {
  name        = "operational-risk"
  description = "operational risk policy"
  type        = "Operational_Risk"  # terraform documentation says "Operational_Risk", which is wrong

  rule {
    name     = "the-rule"
    priority = 1

    criteria {
      op_risk_min_risk = "Medium"
    }

    actions {
      webhooks                          = []
      mails                             = []
      block_release_bundle_distribution = false
      fail_build                        = false
      notify_watch_recipients           = false
      notify_deployer                   = false
      create_ticket_enabled             = false

      block_download {
        unscanned = false
        active    = false
      }
    }
  }
}

Expected behavior

Additional context

 Error: 
│ 400 PUT https://artifactory.katanagraph.io/xray/api/v2/policies/operational-risk
│ {"error":"Got Invalid Policy 'operational-risk'"}
danielmkn commented 1 year ago

Hi @RobertBlumen! Thanks for the ticket. This error message is coming from the API response and we can't fix it in the provider. I'll ask the Xray team if they can clarify the error message.