generated from ExamProCo/terraform-beginner-bootcamp-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
21 lines (19 loc) · 788 Bytes
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
variable "user_uuid" {
description = "The UUID of the user"
type = string
validation {
condition = can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", var.user_uuid))
error_message = "The user_uuid value is not a valid UUID."
}
}
variable "bucket_name" {
description = "The name of the S3 bucket"
type = string
validation {
condition = (
length(var.bucket_name) >= 3 && length(var.bucket_name) <= 63 &&
can(regex("^[a-z0-9][a-z0-9-.]*[a-z0-9]$", var.bucket_name))
)
error_message = "The bucket name must be between 3 and 63 characters, start and end with a lowercase letter or number, and can contain only lowercase letters, numbers, hyphens, and dots."
}
}