Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows special characters for db password #325

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 13 additions & 11 deletions modules/database/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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
Expand All @@ -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]
}
Loading