I want to create 2 resources in the same terraform config file, specifically 2 “oci_database_db_system” (Oracle DBs). While they are successfully created, the Terraform isn’t informed about the creation of the 1 out of the 2 DBs.
resource "oci_database_db_system" "terra_db_system" {
availability_domain = var.av_domain
compartment_id = var.compartment_id
database_edition = "ENTERPRISE_EDITION"
node_count = 1
db_home {
database {
admin_password = var.dbs_admin_password
tde_wallet_password = var.dbs_admin_password
pdb_name = "pdb"
db_name = "cdb"
}
db_version = "19.12.0.0"
}
hostname = "testdb"
shape = var.db_system_shape
data_storage_size_in_gb = 256
display_name = "testDB"
domain = var.dnsname-adminsubnet
source = "NONE"
ssh_public_keys = [file("./key_db.pub")]
subnet_id = var.subnet_admin
db_system_options {
storage_management = "ASM"
}
license_model = "BRING_YOUR_OWN_LICENSE"
}
resource "oci_database_db_system" "terra_db_rack" {
availability_domain = var.av_domain
compartment_id = var.compartment_id
database_edition = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE"
node_count = 2
db_home {
database {
admin_password = var.dbs_admin_password
tde_wallet_password = var.dbs_admin_password
pdb_name = "pdb"
db_name = "cdb"
}
db_version = "19.12.0.0"
}
hostname = "testrack"
shape = var.db_system_shape
data_storage_size_in_gb = 256
display_name = "testRack"
domain = var.dnsname-adminsubnet
source = "NONE"
ssh_public_keys = [file("./key_db.pub")]
subnet_id = var.subnet_admin
db_system_options {
storage_management = "ASM"
}
license_model = "BRING_YOUR_OWN_LICENSE"
}
Output:
oci_database_db_system.terra_db_system: Still creating... [48m40s elapsed]
oci_database_db_system.terra_db_rack: Still creating... [48m40s elapsed]
oci_database_db_system.terra_db_system: Creation complete after 48m44s [id=ocid1.dbsystem.oc1.eu-frankfurt-1.antheljs2xzotoiaeqceqb6ffrpef2rdjrhwjinjlvoewfv5uqsk36433wia]
oci_database_db_system.terra_db_rack: Still creating... [48m50s elapsed]
...
oci_database_db_system.terra_db_rack: Still creating... [2h0m31s elapsed]
At about 1h20m, both DBs are up and running (observed at the OCI administration page) despite the misinformed output above.
So, a) the steps that follow and are dependent on the successful creation of the second resource, are never executed.
Moreover, the terraform.tfstate contains nothing related to the DB that is created but Terraform hasn’t been informed about.
So, b) the terraform destroy will never destroy this resource.
It seems that there is some misbehavior in the Terraform health check regarding the successful creation of all the resources.
Do you have any idea how I could overcome this issue?