From 51abeec0d1eacf9d29e3ea5e0e8582c103d3c46c Mon Sep 17 00:00:00 2001 From: Sandra Maria Peter <83961684+sandrampeter@users.noreply.github.com> Date: Sun, 26 May 2024 22:07:45 -0400 Subject: [PATCH] Update modules/aurora_database_cluster/variables.tf Co-authored-by: Nikolas Rieble --- modules/aurora_database_cluster/variables.tf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/aurora_database_cluster/variables.tf b/modules/aurora_database_cluster/variables.tf index 3f4b44a7..5c812066 100644 --- a/modules/aurora_database_cluster/variables.tf +++ b/modules/aurora_database_cluster/variables.tf @@ -9,11 +9,21 @@ variable "network_id" { variable "db_name" { type = string description = "PostgreSQL instance name. No special characters." + + validation { + condition = can(regex("^[a-zA-Z0-9]+$", var.db_name)) + error_message = "The db_name must only contain alphanumeric characters." + } } variable "db_username" { type = string description = "PostgreSQL instance username. No special characters." + + validation { + condition = can(regex("^[a-zA-Z0-9]+$", var.db_username)) + error_message = "The db_name must only contain alphanumeric characters." + } } variable "db_size" {