-
Notifications
You must be signed in to change notification settings - Fork 2
/
variables.pkr.hcl
114 lines (94 loc) · 3.03 KB
/
variables.pkr.hcl
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
variable "arch" {
type = string
default = "amd64"
description = "The architecture of the runner. Valid values are 'amd64' or 'arm64'."
validation {
condition = can(regex("^a(md|rm)64$", var.arch))
error_message = "The arch value must be either 'amd64' or 'arm64'."
}
}
variable "backup_aws_regions" {
type = string
description = "A comma-separated list of the AWS regions to copy the AMIs to."
}
variable "branch_name" {
type = string
description = "The name of the GitHub branch the image originated from."
}
variable "default_aws_region" {
type = string
description = "The AWS region to provision EC2 instances in."
}
variable "driver_version" {
type = string
default = ""
description = "The NVIDIA driver version to install on the EC2 instance. If empty, no driver will be installed."
validation {
condition = can(regex("(^\\d{3}$|^$)", var.driver_version))
error_message = "The driver_version value must be an empty string or 3 digits."
}
}
variable "driver_flavor" {
type = string
default = ""
description = "The NVIDIA driver flavor to install."
validation {
condition = can(regex("^(open|legacy|)$", var.driver_flavor))
error_message = "The driver_flavor value must be either 'open' or 'legacy'."
}
}
variable "gh_run_id" {
type = string
default = ""
description = "The GitHub run ID. Used to clean up Packer resources in AWS."
}
variable "gh_token" {
type = string
default = ""
description = "A GitHub token used to authenticate GitHub API calls."
}
variable "headless" {
type = bool
default = false
description = "Whether VNC viewer should not be launched."
}
variable "image_name" {
type = string
default = ""
description = "The name of the image. Used to clean up Packer resources in AWS."
}
variable "os" {
type = string
default = "linux"
description = "The operating system of the runner. Valid values are 'linux' or 'windows'."
validation {
condition = can(regex("^(linux|windows)$", var.os))
error_message = "The arch value must be either 'linux' or 'windows'."
}
}
variable "runner_env" {
type = string
description = "The environment of the runner. Valid values are 'aws' or 'qemu'."
validation {
condition = can(regex("(^aws$|^qemu$)", var.runner_env))
error_message = "The runner_env value must be 'aws' or 'qemu'."
}
}
variable "runner_version" {
type = string
description = "The version of the runner to install. Must be in the format 'x.y.z'."
validation {
condition = can(regex("^\\d+\\.\\d+\\.\\d+$", var.runner_version))
error_message = "The runner_version value must match the pattern '^\\d+\\.\\d+\\.\\d+$'."
}
}
variable "upload_ami" {
type = bool
default = false
description = "Whether to create the AMI."
}
variable "timestamp" {
type = string
default = ""
description = "A timestamp used to create unique names for resources."
}