oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
759 stars 681 forks source link

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

Closed danilomnds closed 1 month ago

danilomnds commented 2 months ago

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

tf-oci-pub commented 2 months ago

Thank you for reporting the issue. We observed the affected resources are not provided in the description or it's incorrect. We request you to add it in issue description as mentioned in below format. Example: affected_resources = oci_core_instance , oci_core_instances

If it's not related to any particular resource then mention affected resource as terraform. Example: affected_resources = terraform

As this works through automation, request you to follow exact syntax.

danilomnds commented 2 months ago

Affected resource "oci_database_autonomous_database".

danilomnds commented 1 month ago

Was a problem on the documentation. The db_version parameter 19c is not support. We solved the problem using 19.24.0.1.0.