jfrog / terraform-provider-xray

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

Ensure the `name` attribute is set on the `xray_watch` resource #88

Closed cawilson closed 1 year ago

cawilson commented 2 years ago

Performing a terraform import on an xray_watch resource fails to set the name attribute in the state file and hence, causes Terraform to want to re-create the resource on the next apply to correctly set the name.

Looking at the xray_security_policy (which does work), it appears that when packing the watch, the code was missing the assignment of the name attribute.

(See as per https://github.com/jfrog/terraform-provider-xray/blob/c7c60cc970811fdf214c2f1170d2a5dabdf59517/pkg/xray/policies.go#L620 in the xray_security_policy)

cawilson commented 1 year ago

LGTM. I'll update CHANGELOG in separate PR and then make a release.

Thank you!