Skip to content

Commit

Permalink
Added validation for resource prefix
Browse files Browse the repository at this point in the history
Closes #121
  • Loading branch information
airizarryDB committed Jan 22, 2025
1 parent ae42400 commit f0333a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions aws-gov/tf/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ variable "resource_prefix" {
type = string

validation {
condition = can(regex("^[a-z0-9-]+$", var.resource_prefix))
error_message = "Invalid resource prefix. Allowed characters are a-z, 0-9, -"
condition = can(regex("^[a-z0-9-.]{1,40}$", var.resource_prefix))
error_message = "Invalid resource prefix. Allowed characters are a-z, 0-9, -, ."
}
}

Expand Down
4 changes: 2 additions & 2 deletions aws/tf/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ variable "resource_prefix" {
type = string

validation {
condition = can(regex("^[a-z0-9-]+$", var.resource_prefix))
error_message = "Invalid resource prefix. Allowed characters are a-z, 0-9, -"
condition = can(regex("^[a-z0-9-.]{1,40}$", var.resource_prefix))
error_message = "Invalid resource prefix. Allowed characters are a-z, 0-9, -, ."
}
}

0 comments on commit f0333a5

Please sign in to comment.