jfrog / terraform-provider-xray

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

terraform apply -replace generate a 404 #119

Closed Nereis closed 1 year ago

Nereis commented 1 year ago

I deleted a terraform managed resources directly on xray and I'm not trying to recreate it from terraform but even the -replace option, I'm still getting a 404 error

> terraform apply -target=module.xray-common.xray_watch.ban-cl-strong -replace=module.xray-common.xray_watch.ban-cl-strong
│ Error: 
│ 404 GET https://artifactory.dev.elca.ch/xray/api/v2/watches/ban-cl-strong
│ {"error":"Watch was not found"}
│ 
│   with module.xray-common.xray_watch.ban-cl-strong,
│   on ../../../modules/terraform-xray-common/licenses_copyleft_watches.tf line 70, in resource "xray_watch" "ban-cl-strong":
│   70: resource "xray_watch" "ban-cl-strong" {

Requirements for and issue Setup identical to #117 Create a resource with terraform, delete it on Xray and try to recover it.

Expected behavior The -replace option should force the creation of the resource without even if the resource is missing.

Additional context Taint command has also been tried but lead to the same error as #117

danielmkn commented 1 year ago

@Nereis could you please provide a working HCL so I can reproduce it?

Nereis commented 1 year ago

Fixed with #117 thanks!