Why did Terraform replace my instance?
Your Terraform script deleted your Cloud Databases instance. Why did this happen, and what can I do?
You ran your Terraform script and now your instance has been deleted. You may have seen an output that looks like:
ibm_database.database_instance must be replaced
Terraform can force a new resource when certain attributes are modified. Altering certain attributes recreates your instance, for example: resource_group_id
, service plan
, version
, key_protect_instance
,
key_protect_key
, and backup_encryption_key_crn
.
Before executing a Terraform script on an existing instance, use the terraform plan
command to compare the current infrastructure state with the desired state defined in your Terraform files. Any alteration to the resource_group_id
,
service plan
, version
, key_protect_instance
, key_protect_key
, backup_encryption_key_crn
attributes recreates your instance. For a list of current argument references with the Forces new resource
specification, see the ibm_database Terraform Registry.