terraform-provider-artifactory icon indicating copy to clipboard operation
terraform-provider-artifactory copied to clipboard

Support detecting wrong resource configuration in stage "terraform plan"

Open gyzong1 opened this issue 9 months ago • 0 comments

Is your feature request related to a problem? Please describe.

When the resource configuration is wrong, the command "terraform plan" should report error message.

  1. Such as when we want to create two duplicate users in Artifactory, and the wrong main.tf is:

`terraform { required_providers { artifactory = { source = "jfrog/artifactory" version = "10.7.4" } } }

provider "artifactory" { url = "http://localhost:8082/artifactory" access_token = "xxxxx"

}

resource "artifactory_user" "example_user2" { name = "user2" email = "[email protected]" admin = false groups = [ "readers" ] } resource "artifactory_user" "example_user3" { name = "user2" email = "[email protected]" admin = false groups = [ "readers" ] }`

  1. Then, we execute the command:

terraform plan

  1. The response is normal (It should be wrong due to the username is duplicate): terraform_plan

Describe the solution you'd like The response should report an error such as "Error: Unable to Create Resource due to the user is duplicate"

$ terraform -v Terraform v1.8.3 on darwin_amd64 provider registry.terraform.io/jfrog/artifactory v10.7.4

gyzong1 avatar May 21 '24 09:05 gyzong1