Repository navigation
Expand file tree
/
Copy pathvariables.tf
More file actions
155 lines (130 loc) · 3.88 KB
/
Copy pathvariables.tf
File metadata and controls
155 lines (130 loc) · 3.88 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
variable "instance_name" {
description = "Name of the instance, used in the full instance name"
type = string
validation {
condition = length(var.instance_name) > 0
error_message = "Instance name cannot be empty."
}
}
variable "app_name" {
description = "Application name, used as prefix in the full instance name"
type = string
validation {
condition = length(var.app_name) > 0
error_message = "Application name cannot be empty."
}
}
variable "instance_index" {
description = "Index or identifier for the instance, used as suffix in the full instance name"
type = number
validation {
condition = var.instance_index >= 0
error_message = "Instance index must be a non-negative number."
}
}
variable "image_name" {
description = "Name of the image to use for the instance (Optional; Required if image_id is empty)"
type = string
default = null
nullable = true
}
variable "flavor_name" {
description = "Name of the flavor to use for the instance (Optional; Required if flavor_id is empty)"
type = string
default = null
nullable = true
}
variable "image_id" {
description = "ID of the image to use for the instance (Optional; Required if image_name is empty or if configuring an OS volume)"
type = string
default = null
nullable = true
}
variable "flavor_id" {
description = "ID of the flavor to use for the instance (Optional; Required if flavor_name is empty)"
type = string
default = null
nullable = true
}
variable "keypair_name" {
description = "Name of the keypair to use for SSH access to the instance"
type = string
}
variable "cloudinit_userdata" {
description = "User data for cloud-init to be passed to the instance"
type = string
default = null
}
variable "networks" {
description = "List of network names to attach the instance to"
type = list(string)
nullable = false
}
#tflint-ignore: terraform_unused_declarations
variable "add_sfs_network" {
description = "Shared File System network to add (if needed)"
type = string
default = null
}
variable "instance_has_fip" {
description = "Whether to assign a floating IP to the instance"
type = bool
default = false
}
variable "security_groups" {
description = "List of security group names to apply to the instance"
type = list(string)
default = ["default"]
nullable = false
}
variable "os_volume" {
description = "Configuration for the primary OS volume"
type = object({ enable = bool, size = number })
default = {
enable = true
size = 50
}
}
variable "extra_volume" {
description = "Whether to attach an additional volume to the instance"
type = bool
default = false
}
variable "extra_volume_size" {
description = "Size in GB of the additional volume"
type = number
default = 1
validation {
condition = var.extra_volume_size > 0
error_message = "Volume size must be greater than 0."
}
}
variable "extra_volume2" {
description = "Whether to attach a second additional volume to the instance"
type = bool
default = false
}
variable "extra_volume2_size" {
description = "Size in GB of the second additional volume"
type = number
default = 1
validation {
condition = var.extra_volume2_size > 0
error_message = "Volume size must be greater than 0."
}
}
variable "instance_metadata" {
description = "Metadata to associate with the instance (key-value pairs)"
type = map(string)
default = null
}
variable "external_network_name" {
description = "Name of the external network for floating IPs"
type = string
default = "external"
}
variable "tags" {
description = "A map of tags to assign to all resources that support it"
type = map(string)
default = {}
}