I am creating secret manager instance using terraform called through jenkins.
I am providing an option to give the name.
eg. options - ["abc", "xyz"]
What I want is, if user selects "abc", an instance with name "abc" should be created. If second time, user selects "xyz", an instance should be create with name "xyz" but don't delete "abc" if its exists.
code -
resource "ibm_resource_instance" "secret_manager_instance" {
name = var.name
service = "secrets-manager"
...
}
Here name is changing. Problem is, when second time the script executes, its sees change in name and tries recreating it with new name. I want "abc" should exists and "xyz" should be created. Is there any way in terraform to perform this ?