-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvariables.tf
65 lines (54 loc) · 2.11 KB
/
variables.tf
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
variable "v1latest" {
type = string
description = "The version of terraform cli for all workspace that is v1"
validation {
condition = substr(var.v1latest, 0, 2) == "1."
error_message = "The terraform cli version must match 1.*."
}
default = "1.10.4"
}
variable "github_personal_token" {
type = string
description = "The github.com personal token"
validation {
condition = length(var.github_personal_token) > 4 && substr(var.github_personal_token, 0, 4) == "ghp_"
error_message = "The github_personal_token value must be a valid github personal token, starting with \"ghp_\"."
}
}
variable "gitlab_personal_token" {
type = string
description = "The gitlab.com personal token"
validation {
condition = length(var.gitlab_personal_token) > 19
error_message = "The gitlab_personal_token value must be a valid https://gitlab.com personal token, longer than 20 characters."
}
}
variable "snyk_hmac_key" {
type = string
description = "HMAC key for Sync.io integration."
}
variable "infracost_hmac_key" {
type = string
description = "HMAC key for infracost.io integration."
}
variable "organization" {
type = string
description = "Name of TFC/E organization"
}
variable "tfe_token" {
type = string
validation {
condition = length(var.tfe_token) >= 90 && can(regex("[[:alnum:]]+.atlasv1.[[:alnum:]]+", var.tfe_token))
error_message = "The tfe_token value must be a valid TFC/E personal token, containing substring \".atlasv1.\" in the middle."
}
description = "TFC/E token that has permission to manage workspace/policy-set/variable/notification/tags, note that orgnization/team token are not enough."
}
variable "aws_default_region" {
type = string
description = "the default AWS_REGION"
default = "ap-southeast-2"
validation {
condition = length(var.aws_default_region) > 8 && can(regex("[[:alpha:]]+-[[:alpha:]]+-[0-9]", var.aws_default_region))
error_message = "The variable aws_default_region must be longer than 8 chars and meet the format of [[:alpha:]]+-[[:alpha:]]+-[0-9]."
}
}