You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing OCI (DRCC) Database forces replacement of the Database when database_management_config block is in place in imported resource. Even when database management is disabled.
Ignoring more or less options does not help.
Import of Database is needed to update "Defined_Tags" after Database has been created using different terraform code.
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
# oci_database_database.database_cloud_vm_clusters[7] must be replaced# (imported from "ocid1.database.xxxxxxx")# Warning: this will destroy the imported resource-/+resource"oci_database_database""database_cloud_vm_clusters" {
~ character_set="EE8ISO8859P2"-> (known after apply)
~ compartment_id="ocid1.compartment.xxxxxxxx"-> (known after apply)
~ connection_strings=[
- {
- all_connection_strings = {
-"cdbDefault" = "xxxxxxx"
}
- cdb_default ="xxxxxxx"
},
] -> (known after apply)
~ database_management_config=[
- {
- management_status ="DISABLED"- management_type ="ADVANCED"
},
] -> (known after apply)
+database_software_image_id=(known after apply)
~ db_backup_config=[
- {
- auto_backup_enabled =false
auto_backup_window =null
auto_full_backup_day =null
auto_full_backup_window =null
backup_deletion_policy =null- backup_destination_details = []
- recovery_window_in_days =30- run_immediate_full_backup =false
},
] -> (known after apply)
db_home_id="ocid1.dbhome.xxxxxxx"
~ db_name="xxxxxx"-> (known after apply)
+db_system_id=(known after apply)
~ db_unique_name="xxxxxxxxx"-> (known after apply)
+db_version=(known after apply)
~ db_workload="OLTP"-> (known after apply)
~ defined_tags={
-"Oracle-Tags.CreatedBy" = "x"-"Oracle-Tags.CreatedOn" = "x"-"drcc-Tags.BS_Company" = "xxxxxx"-"drcc-Tags.BS_ServiceName" = "xxxxxxx"-"drcc-Tags.DRCCOffering" = "xxxxxx"-"drcc-Tags.IDMGroup" = "xx"-"drcc-Tags.LocalMarket" = "xxxx"-"drcc-Tags.SupportGroup" = "xxxxxxx"-"drcc-Tags.region" = "xxxxxx"-"drcc-Tags.resource" = "database"
} -> (known after apply)
~ freeform_tags={} -> (known after apply)
~ id="ocid1.database.xxxxxxxxx"-> (known after apply)
~ is_cdb=false-> (known after apply)
+key_store_id=(known after apply)
+key_store_wallet_name=(known after apply)
+kms_key_id=(known after apply)
+last_backup_duration_in_seconds=(known after apply)
~ last_backup_timestamp="+0000 UTC"-> (known after apply)
+last_failed_backup_timestamp=(known after apply)
+lifecycle_details=(known after apply)
~ ncharacter_set="AL16UTF16"-> (known after apply)
+pdb_name=(known after apply)
~ sid_prefix="XXXXXX"-> (known after apply)
+source="NONE"+source_database_point_in_time_recovery_timestamp=(known after apply)
~ state="AVAILABLE"-> (known after apply)
~ time_created="+0000 UTC"-> (known after apply)
+vault_id=(known after apply)
~ vm_cluster_id="ocid1.cloudvmcluster.xxxxxxxxx"-> (known after apply)
+database {
# Warning: this attribute value will be marked as sensitive and will not# display in UI output after applying this change. The value is unchanged.admin_password=(sensitive value)
+character_set=(known after apply)
+database_software_image_id=(known after apply)
+db_name="XXXXXXXX"# forces replacement+db_unique_name=(known after apply)
+db_workload=(known after apply)
+defined_tags={
+"drcc-Tags.BS_ServiceName" = "XXXXXXXXX"
}
+freeform_tags=(known after apply)
+kms_key_id=(known after apply)
+kms_key_version_id=(known after apply)
+ncharacter_set=(known after apply)
+pdb_name=(known after apply)
+pluggable_databases=(known after apply) # forces replacement+sid_prefix=(known after apply)
+tde_wallet_password=(sensitive value)
+vault_id=(known after apply)
+ db_backup_config (known after apply)
}
}
import {
for_each=local.all_databases_cloud_vm_clusters.*.id# ID of the cloud resource# Check provider documentation for importable resources and formatid=each.value# Resource addressto=oci_database_database.database_cloud_vm_clusters[each.key]
}
resource"oci_database_database""database_cloud_vm_clusters" {
count=length(local.all_databases_cloud_vm_clusters)
#Requireddb_home_id=local.all_databases_cloud_vm_clusters[count.index].db_home_idsource="NONE"database {
#Requiredadmin_password=""db_name=local.all_databases_cloud_vm_clusters[count.index].db_name#Optional#Optionaldefined_tags={
"drcc-Tags.BS_ServiceName"="xxxxxx"
}
}
#Optionallifecycle {
ignore_changes=[source,
database[0].defined_tags["Oracle-Tags.CreatedBy"],
database[0].defined_tags["Oracle-Tags.CreatedOn"],
]
}
}
Debug Output
Panic Output
Expected Behavior
Actual Behavior
Steps to Reproduce
configure data resources to collect the data for databases to be imported
configure import and resource block to import the databases
run 'terraform init' and 'terraform plan' to get a plan that forces the replacement of the database to be imported when the plan would be applied.
Important Factoids
Database with problems happen to be ExaCS Databases that have to be imported with oci_database_db_home or oci_database_database.
DBCS databases that are imported as oci_database_db_system do not seem to have this problem, but not 100% sure if database_management_config block is in place for DBCS.
References
The text was updated successfully, but these errors were encountered:
I can confirm that the issue is only when importing oci_database_database or oci_database_db_home.
oci_database_db_system can be imported with database_management_config block in place without the "forces replacement"
Importing OCI (DRCC) Database forces replacement of the Database when database_management_config block is in place in imported resource. Even when database management is disabled.
Ignoring more or less options does not help.
Import of Database is needed to update "Defined_Tags" after Database has been created using different terraform code.
Community Note
Terraform Version and Provider Version
terraform -v
Terraform v1.10.2
on darwin_arm64
Affected Resource(s)
oci_database_database
oci_database_db_home
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Actual Behavior
Steps to Reproduce
Important Factoids
Database with problems happen to be ExaCS Databases that have to be imported with oci_database_db_home or oci_database_database.
DBCS databases that are imported as oci_database_db_system do not seem to have this problem, but not 100% sure if database_management_config block is in place for DBCS.
References
The text was updated successfully, but these errors were encountered: