Error: 400-InvalidParameter, The Autonomous Database's Container Database ID cannot be null. #35687

Terraform Version

Terraform v1.9.5
on windows_amd64
+ provider registry.terraform.io/hashicorp/oci v6.6.0

Terraform Configuration Files

I’m trying to create an autonomous database “serverless”.
The parameter “autonomous_container_database_id” according to the documentation is optional, but I’m getting an error that says this parameter cannot be null.

This error is generated only in “terraform apply” step.

Use case with a module, but using the resource I got the same error.
I tried to remove this parameter in the module but it didn’t work either.


module "adb-<region>-<env>-<system>-<id>" {    
  source = "git::https://github.com/danilomnds/terraform-oci-autonomous-database?ref=v1.0.0"
  compartment_id = <compartment id>
  admin_password = "Password"
  db_name = <db name>  
  display_name = "adb-vcp-prd-coe-001"
  /*not using it autonomous_container_database_id = <autonomous container database id>*/
  character_set = "AL32UTF8"
  compute_model = "ECPU"
  cpu_core_count = 4
  data_storage_size_in_gb = 250
  database_edition = "ENTERPRISE_EDITION"
  db_version = "19c"
  db_workload = "AJD" # options are OLTP/DW/AJD/APEX
  is_dedicated = true #if exadata dedicated infrastructure is being used
  ncharacter_set = "AL16UTF16"
  subnet_id = <snet id>
  defined_tags = {
    "IT.area":"infrastructure"
    "IT.department":"ti"    
  }
}
output "autonomous-database-name" {
  value = module.adb-<region>-<env>-<system>-<id>.display_name
}
output "autonomous-database-id" {
  value = module.adb-<region>-<env>-<system>-<id>.id
}

Debug Output

n/a

Expected Behavior

Creation of an autonomous database serverless

Actual Behavior

Error: 400-InvalidParameter, The Autonomous Database’s Container Database ID cannot be null.
│ Suggestion: Please update the parameter(s) in the Terraform config as per error message The Autonomous Database’s Container Database ID cannot be null.
│ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/database_autonomous_database
│ API Reference: https://docs.oracle.com/iaas/api/#/en/database/20160918/AutonomousDatabase/CreateAutonomousDatabase
│ Request Target: POST https://database.sa-vinhedo-1.oraclecloud.com/20160918/autonomousDatabases
│ Provider version: 6.6.0, released on 2024-08-10. This provider is 3 Update(s) behind to current.
│ Service: Database Autonomous
│ Operation Name: CreateAutonomousDatabase
│ OPC request ID: f937f43617088e91aad37b3fe714fdef/B2A3A27995358A9731F5C1CA226CE58D/6F87E7DB47527783C4AE32F55319153B


│ with module.adb-vcp-fqa-sfpp-001.oci_database_autonomous_database.autonomous_database,
│ on .terraform\modules\adb-vcp-fqa-sfpp-001\main.tf line 1, in resource “oci_database_autonomous_database” “autonomous_database”:
│ 1: resource “oci_database_autonomous_database” “autonomous_database” {

Steps to Reproduce

terraform apply

Additional Context

No response

References

No response