Skip to content

Commit

Permalink
Parameterize mysql db having special chars
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Aug 26, 2022
1 parent c2a536b commit 4b50627
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 2 additions & 3 deletions terraform/aws/db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ resource "random_password" "db_root_password" {
}

resource "random_password" "db_readonly_password" {
count = var.db_enabled ? 1 : 0
# FIXME: Parameterize it
special = false
count = var.db_enabled ? 1 : 0
special = var.db_mysql_user_password_special_chars
# mysql passwords can't be longer than 41 chars lololol
length = 41
}
Expand Down
4 changes: 3 additions & 1 deletion terraform/aws/projects/allen-swdb.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ hub_cloud_permissions = {

db_mysql_params = {
"max_allowed_packet": "1073741824"
}
}

db_mysql_user_password_special_chars = false
7 changes: 7 additions & 0 deletions terraform/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,10 @@ variable "db_mysql_params" {
Mapping of parameters to set on the mysql server
EOT
}

variable "db_mysql_user_password_special_chars" {
default = true
description = <<-EOT
Set to True if you don't want special characters in generated mysql passwords
EOT
}

0 comments on commit 4b50627

Please sign in to comment.