terraform-provider-oci icon indicating copy to clipboard operation
terraform-provider-oci copied to clipboard

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

Open dhoogfr opened this issue 2 years ago • 3 comments

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

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

dhoogfr avatar Jun 02 '22 08:06 dhoogfr

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

robnevdal avatar Aug 19 '22 08:08 robnevdal

No response so far

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

dhoogfr avatar Aug 19 '22 12:08 dhoogfr

I'm on 4.88.1

robnevdal avatar Aug 19 '22 13:08 robnevdal

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

tf-oci-pub avatar Apr 24 '23 13:04 tf-oci-pub