Skip to content

Commit

Permalink
use null instead of empty string
Browse files Browse the repository at this point in the history
Try to resolve errors: '"username": conflicts with replicate_source_db' and 'expected replica_mode to be one of [open-read-only mounted]'
  • Loading branch information
briskt committed May 23, 2023
1 parent ddee614 commit 77f8ae1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions aws/rds/mariadb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ resource "aws_db_instance" "db_instance" {
allocated_storage = var.allocated_storage
copy_tags_to_snapshot = var.copy_tags_to_snapshot
instance_class = var.instance_class
db_name = var.replicate_source_db == "" ? var.db_name : ""
db_name = var.replicate_source_db == null ? var.db_name : null
identifier = "${var.app_name}-${var.app_env}"
username = var.replicate_source_db == "" ? var.db_root_user : ""
password = var.replicate_source_db == "" ? var.db_root_pass : ""
username = var.replicate_source_db == null ? var.db_root_user : null
password = var.replicate_source_db == null ? var.db_root_pass : null
db_subnet_group_name = var.subnet_group_name
storage_type = var.storage_type
storage_encrypted = var.storage_encrypted
Expand Down
4 changes: 2 additions & 2 deletions aws/rds/mariadb/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ variable "tags" {
variable "replicate_source_db" {
type = string
description = "To create a replica DB, specify the source database"
default = ""
default = null
}

variable "replica_mode" {
type = string
description = "Specifies whether the replica is in either \"mounted\" or \"open-read-only\" mode. This attribute is only supported by Oracle instances."
default = ""
default = null
}

0 comments on commit 77f8ae1

Please sign in to comment.