Skip to content

Master password output broken after setting manage_master_user_password #126

@aram039

Description

@aram039

Describe the Bug

│ Error: Invalid function argument
│ 
│   on .terraform/modules/documentdb/outputs.tf line 7, in output "master_password":
│    7:   value       = var.manage_master_user_password != null ? join("", aws_docdb_cluster.default[*].master_password) : null
│     ├────────────────
│     │ while calling join(separator, lists...)
│     │ aws_docdb_cluster.default is tuple with 1 element
│ 
│ Invalid value for "lists" parameter: element 0 is null; cannot concatenate null values.

Expected Behavior

No Error and able to apply changes

Steps to Reproduce

module "documentdb" {
  source  = "cloudposse/documentdb-cluster/aws"
  version = "0.30.1"

  ca_cert_identifier        = "rds-ca-rsa2048-g1"
  apply_immediately         = false
  # deletion_protection       = true
  name                      = "documentdb"
  cluster_size              = 1
  master_username           = "administrator"
  manage_master_user_password = true
  instance_class            = "db.t3.medium"
  vpc_id                    = data.aws_vpc.workload_vpc.id

  subnet_ids                = local.workload_private_subnet_ids
  allowed_security_groups   = local.trustd_docdb_lambda_sg_ids

  allowed_cidr_blocks = ["0.0.0.0/0"]

  cluster_family               = "docdb4.0"
  engine_version               = "4.0.0"
  preferred_backup_window      = "00:00-00:30"
  preferred_maintenance_window = "sun:05:00-sun:05:30"
}


Screenshots

No response

Environment

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions