Skip to content

Commit

Permalink
Add validation to database_password
Browse files Browse the repository at this point in the history
  • Loading branch information
kay-kim committed Feb 25, 2025
1 parent aa260b3 commit 07224a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ variable "database_password" {
description = "Password for the database (should be provided via tfvars or environment variable)"
type = string
sensitive = true
validation {
condition = length(var.database_password) >= 8 && can(regex("^[[:print:]]+$", var.database_password)) && !can(regex("[/@\" ]", var.database_password))
error_message = "Database password must be at least 8 characters, contain only printable ASCII characters, excluding '/', '@', '\"' (double quotes), and ' ' (space)."
}
}

variable "db_multi_az" {
Expand Down

0 comments on commit 07224a1

Please sign in to comment.