oracle / terraform-provider-oci

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

Specifying auto_backup_window with oci_database_db_system resource gives "Unable to process JSON input" #1606

Open dhoogfr opened 2 years ago

dhoogfr commented 2 years ago

Community Note

Terraform Version and Provider Version

Terraform v1.2.1
on linux_amd64
+ provider registry.terraform.io/oracle/oci v4.78.0

Affected Resource(s)

oci_database_db_system

Terraform Configuration Files

resource "oci_database_db_system" "this" {
  compartment_id                  = var.db_compartment_id
  availability_domain             = var.db_availability_domain
  fault_domains                   = [var.db_fault_domain]
  display_name                    = var.db_display_name
  hostname                        = var.db_hostname
  shape                           = var.db_shape
  ssh_public_keys                 = [var.db_ssh_public_key]
  subnet_id                       = var.db_subnet_id
  nsg_ids                         = var.db_sg_list
  license_model                   = var.license_model
  node_count                      = "1"
  database_edition                = var.db_edition
  data_storage_size_in_gb         = var.db_storage_size
  cpu_core_count                  = var.cpu_core_count
  storage_volume_performance_mode = var.storage_volume_performance_mode

  db_home {
    database {
      admin_password = var.db_admin_password

      character_set  = var.db_character_set
      ncharacter_set = var.db_ncharacter_set
      db_name        = var.db_cdb_name

      pdb_name = var.db_pdb_name

      db_backup_config {
        auto_backup_enabled     = true
        recovery_window_in_days = var.db_recovery_window
        auto_backup_window      = var.db_auto_backup_window
      }

    }

    db_version = var.db_version
  }

  defined_tags  = var.defined_tags
  freeform_tags = var.freeform_tags

  lifecycle {
    #    prevent_destroy = true
    ignore_changes = [db_home[0].database[0].admin_password, db_home[0].db_version]
  }

  timeouts {
    create = "180m"
  }
}

Debug Output

https://gist.github.com/dhoogfr/dadc39134602de33afb21416cd65b11e

Panic Output

Expected Behavior

Database should be created with the automatic db backup scheduled according to the time slot 2

Actual Behavior

creation failed with message

β”‚ Error: 400-InvalidParameter, Unable to process JSON input 
β”‚ Suggestion: Please update the parameter(s) in the Terraform config as per error message Unable to process JSON input
β”‚ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/database_db_system 
β”‚ API Reference: https://docs.oracle.com/iaas/api/#/en/database/20160918/DbSystem/LaunchDbSystem 
β”‚ Request Target: POST https://database.eu-amsterdam-1.oraclecloud.com/20160918/dbSystems 
β”‚ Provider version: 4.78.0, released on 2022-06-02.  
β”‚ Service: Database Db System 
β”‚ Operation Name: LaunchDbSystem 
β”‚ OPC request ID: 51c4d022ec86825b5ea8a4f0dc844351/B981DFA82731CD1BFD963BBEB8F7A69E/90027756E4A7AA3260A7D2909FB83D64 
β”‚ 
β”‚ 
β”‚   with module.exi_dbcs_omp.oci_database_db_system.this,
β”‚   on .terraform/modules/exi_dbcs_omp/dbcs.tf line 1, in resource "oci_database_db_system" "this":
β”‚    1: resource "oci_database_db_system" "this" {
β”‚ 

Steps to Reproduce

  1. terraform apply

Important Factoids

References

robnevdal commented 2 years ago

Hi I am getting the same thing, did you get a fix for this? Thanks Rob

dhoogfr commented 2 years ago

No response so far

Did not test it with the newer oci terraform provider Which version are you on?

robnevdal commented 2 years ago

I'm on 4.88.1

tf-oci-pub commented 1 year ago

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.