Describe the bug
After a provider upgrade from 2.11.0 to 2.11.1 we started getting error when applying xray_security_policy resources even if they have not changed.
Terraform configuration:
resource "xray_security_policy" "high_severity_cve" {
name = "high-severity-cve"
description = "This security policy generates a violation for high-severity CVEs with a CVSS score of 7.0-10.0"
type = "security"
rule {
name = "high-severity-cve"
priority = 1
criteria {
cvss_range {
from = 7.0
to = 10.0
}
}
actions {
block_download {
active = false
}
}
}
}
Error: Provider produced inconsistent result after apply
│
│ When applying changes to xray_security_policy.high_severity_cve, provider "provider[\"registry.terraform.io/jfrog/xray\"]" produced an unexpected new value: .rule: planned set
│ element
│ cty.ObjectVal(map[string]cty.Value{"actions":cty.SetVal([]cty.Value{cty.ObjectVal(map[string]cty.Value{"block_download":cty.SetVal([]cty.Value{cty.ObjectVal(map[string]cty.Value{"active":cty.False,
│ "unscanned":cty.False})}), "block_release_bundle_distribution":cty.False, "block_release_bundle_promotion":cty.False, "build_failure_grace_period_in_days":cty.NullVal(cty.Number),
│ "create_ticket_enabled":cty.False, "fail_build":cty.False, "mails":cty.NullVal(cty.Set(cty.String)), "notify_deployer":cty.False, "notify_watch_recipients":cty.False,
│ "webhooks":cty.NullVal(cty.Set(cty.String))})}), "criteria":cty.SetVal([]cty.Value{cty.ObjectVal(map[string]cty.Value{"applicable_cves_only":cty.False,
│ "cvss_range":cty.ListVal([]cty.Value{cty.ObjectVal(map[string]cty.Value{"from":cty.NumberIntVal(7), "to":cty.NumberIntVal(10)})}),
│ "exposures":cty.ListValEmpty(cty.Object(map[string]cty.Type{"applications":cty.Bool, "iac":cty.Bool, "min_severity":cty.String, "secrets":cty.Bool, "services":cty.Bool})),
│ "fix_version_dependant":cty.False, "malicious_package":cty.False, "min_severity":cty.NullVal(cty.String), "package_name":cty.NullVal(cty.String),
│ "package_type":cty.NullVal(cty.String), "package_versions":cty.NullVal(cty.Set(cty.String)), "vulnerability_ids":cty.NullVal(cty.Set(cty.String))})}),
│ "name":cty.StringVal("high-severity-cve"), "priority":cty.NumberIntVal(1)}) does not correlate with any element in actual.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
Requirements for and issue
[X] A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue)
[X] Your version of Artifactory and Xray (you can curl Artifactory version at $host/artifactory/api/system/version and Xray version at $host/xray/api/v1/system/version
Expected behavior
We expected either no changes since the resource actually didn't change and definitly don't expect an error when it tries to change id
Describe the bug After a provider upgrade from 2.11.0 to 2.11.1 we started getting error when applying
xray_security_policy
resources even if they have not changed.Terraform configuration:
Terraform apply output
Error:
Requirements for and issue
curl
Artifactory version at$host/artifactory/api/system/version
and Xray version at$host/xray/api/v1/system/version
Expected behavior We expected either no changes since the resource actually didn't change and definitly don't expect an error when it tries to change id
Additional context N/A