jfrog / terraform-provider-xray

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

unable to create xray_repository_config with scanners_category for artifactory_remote_nuget_repository #273

Open FischlerA opened 1 day ago

FischlerA commented 1 day ago

Describe the bug Creating a xray_repository_config for a nuget-remote repository with

resource "artifactory_remote_nuget_repository" "nuget-remote" {
  key                        = "nuget-remote"
  description                = "Enthält alle NuGet-Pakete von NuGet.org"
  url                        = "https://www.nuget.org/"
  download_context_path      = "api/v2/package"
  curated                    = true
  xray_index                 = true
  force_nuget_authentication = true
  v3_feed_url                = "https://api.nuget.org/v3/index.json"
  symbol_server_url          = "https://symbols.nuget.org/download/symbols"
}

resource "xray_repository_config" "xray-repo-config-nuget-remote" {
  repo_name   = artifactory_remote_nuget_repository.nuget-remote.key
  jas_enabled = true
  config {
    vuln_contextual_analysis = false
    retention_in_days        = 180
    exposures {
      scanners_category {
        # nuget remote repos only support secret scanners
        secrets  = true
      }
    }
  }
}

fails with

╷
│ Error: Unable to Create Resource
│ 
│   with xray_repository_config.xray-repo-config-nuget-remote,
│   on nuget-artifact-repos.tf line 17, in resource "xray_repository_config" "xray-repo-config-nuget-remote":
│   17: resource "xray_repository_config" "xray-repo-config-nuget-remote" {
│ 
│ An unexpected error occurred while creating the resource update request.
│ Please report this issue to the provider developers.
│ 
│ Error: {"error":"Request payload is invalid as exposure analysis config is
│ missing"}

Terraform version: 1.2.3 Xray Provider Version: 2.13.2 Artifactory Version: 7.100.2 revision: 80002900 Xray Version: 3.106.7 revision: 3fc2909

Requirements for and issue

Expected behavior I expect to be able to create a xray_repository_config for nuget repositories. For npm repositories it works as it is supposed to.

alexhung commented 1 day ago

@FischlerA Thanks for the report. I've added this to our plan to investigate.