diff --git a/main.tf b/main.tf index 4ba7ef1c..5f6fb10c 100644 --- a/main.tf +++ b/main.tf @@ -117,7 +117,7 @@ module "database" { # Docker Compose File Config for TFE on instance(s) using Flexible Deployment Options # ------------------------------------------------------------------------------------ module "runtime_container_engine_config" { - source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/runtime_container_engine_config?ref=main" + source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/runtime_container_engine_config?ref=special-db" count = var.is_replicated_deployment ? 0 : 1 tfe_license = var.hc_license diff --git a/modules/database/main.tf b/modules/database/main.tf index d7b632b7..53d49a68 100644 --- a/modules/database/main.tf +++ b/modules/database/main.tf @@ -2,8 +2,10 @@ # SPDX-License-Identifier: MPL-2.0 resource "random_string" "postgresql_password" { - length = 128 - special = false + length = 128 + special = true + min_special = 4 + override_special = "$" } resource "aws_security_group" "postgresql" { @@ -59,7 +61,7 @@ resource "aws_db_instance" "postgresql" { instance_class = var.db_size password = random_string.postgresql_password.result # no special characters allowed - username = var.db_username + username = var.db_username allow_major_version_upgrade = false apply_immediately = true @@ -74,12 +76,12 @@ resource "aws_db_instance" "postgresql" { max_allocated_storage = 0 multi_az = true # no special characters allowed - db_name = var.db_name - port = 5432 - publicly_accessible = false - skip_final_snapshot = true - storage_encrypted = true - kms_key_id = var.kms_key_arn - storage_type = "gp2" - vpc_security_group_ids = [aws_security_group.postgresql.id] + db_name = var.db_name + port = 5432 + publicly_accessible = false + skip_final_snapshot = true + storage_encrypted = true + kms_key_id = var.kms_key_arn + storage_type = "gp2" + vpc_security_group_ids = [aws_security_group.postgresql.id] }