-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvars.tf
More file actions
39 lines (36 loc) · 1.37 KB
/
vars.tf
File metadata and controls
39 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
variable "environment" {
description = "Environment (sharedtools, dev, staging, qa, prod)"
type = string
default = "dev"
validation {
condition = contains(["sharedtools", "dev", "staging", "qa", "prod"], var.environment)
error_message = "The environment variable must be one of [sharedtools, dev, staging, qa, prod]."
}
}
variable "product" {
description = "Tag used to group resources according to product"
type = string
default = "guac-around-the-clock-wp"
validation {
condition = can(regex("[a-z\\-]+", var.product))
error_message = "The product variable violates approved regex."
}
}
variable "repo" {
description = "Tag used to point to the repo using this module"
type = string
default = "git@github.com:pbs/devops-interview-2024.git"
validation {
condition = can(regex("(?:git|ssh|https?|git@[-\\w.]+):(\\/\\/)?(.*?)(\\.git)(\\/?|\\#[-\\d\\w._]+?)$", var.repo))
error_message = "The repo variable violates approved regex."
}
}
variable "organization" {
description = "Organization using this module. Used to prefix tags so that they are easily identified as being from your organization"
type = string
default = "pbs"
validation {
condition = can(regex("[a-z\\-]+", var.organization))
error_message = "The organization variable violates approved regex."
}
}