forked from cloudposse/terraform-aws-ec2-instance-group
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
319 lines (268 loc) · 8.96 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
variable "ssh_key_pair" {
type = string
description = "SSH key pair to be provisioned on the instance"
default = ""
}
variable "generate_ssh_key_pair" {
type = bool
description = "If true, create a new key pair and save the pem for it to the current working directory"
default = false
}
variable "associate_public_ip_address" {
type = bool
description = "Associate a public IP address with the instance"
default = false
}
variable "ssh_key_pair_path" {
type = string
description = "Path to where the generated key pairs will be created. Defaults to $$${path.cwd}"
default = ""
}
variable "assign_eip_address" {
type = bool
description = "Assign an Elastic IP address to the instance"
default = true
}
variable "user_data" {
type = string
description = "Instance user data. Do not pass gzip-compressed data via this argument"
default = ""
}
variable "instance_type" {
type = string
description = "The type of the instance"
default = "t2.micro"
}
variable "vpc_id" {
type = string
description = "The ID of the VPC that the instance security group belongs to"
}
variable "security_group_enabled" {
type = bool
description = "Whether to create default Security Group for EC2 instances."
default = true
}
variable "security_group_description" {
type = string
default = "EC2 instances Security Group"
description = "The Security Group description."
}
variable "security_group_use_name_prefix" {
type = bool
default = false
description = "Whether to create a default Security Group with unique name beginning with the normalized prefix."
}
variable "security_group_rules" {
type = list(any)
default = [
{
type = "egress"
from_port = 0
to_port = 65535
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
description = "Allow all outbound traffic"
}
]
description = <<-EOT
A list of maps of Security Group rules.
The values of map is fully complated with `aws_security_group_rule` resource.
To get more info see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule .
EOT
}
variable "security_groups" {
type = list(string)
default = []
description = "A list of Security Group IDs to associate with EC2 instances."
}
variable "subnet" {
type = string
description = "VPC Subnet ID the instance is launched in"
}
variable "region" {
type = string
description = "AWS Region the instance is launched in"
}
variable "availability_zone" {
type = string
description = "Availability Zone the instance is launched in. If not set, will be launched in the first AZ of the region"
default = ""
}
variable "ami" {
type = string
description = "The AMI to use for the instance"
}
variable "ami_owner" {
type = string
description = "Owner of the given AMI"
}
variable "ebs_optimized" {
type = bool
description = "Launched EC2 instance will be EBS-optimized"
default = false
}
variable "disable_api_termination" {
type = bool
description = "Enable EC2 Instance Termination Protection"
default = false
}
variable "monitoring" {
type = bool
description = "Launched EC2 instance will have detailed monitoring enabled"
default = true
}
variable "private_ips" {
type = list(string)
description = "Private IP address to associate with the instances in the VPC"
default = []
}
variable "source_dest_check" {
type = bool
description = "Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs"
default = true
}
variable "ipv6_address_count" {
type = number
description = "Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet"
default = 0
}
variable "ipv6_addresses" {
type = list(string)
description = "List of IPv6 addresses from the range of the subnet to associate with the primary network interface"
default = []
}
variable "root_volume_type" {
type = string
description = "Type of root volume. Can be standard, gp2 or io1"
default = "gp2"
}
variable "root_volume_size" {
type = number
description = "Size of the root volume in gigabytes"
default = 10
}
variable "root_iops" {
type = number
description = "Amount of provisioned IOPS. This must be set if root_volume_type is set to `io1`"
default = 0
}
variable "ebs_device_names" {
type = list(string)
description = "Name of the EBS device to mount"
default = ["/dev/xvdb", "/dev/xvdc", "/dev/xvdd", "/dev/xvde", "/dev/xvdf", "/dev/xvdg", "/dev/xvdh", "/dev/xvdi", "/dev/xvdj", "/dev/xvdk", "/dev/xvdl", "/dev/xvdm", "/dev/xvdn", "/dev/xvdo", "/dev/xvdp", "/dev/xvdq", "/dev/xvdr", "/dev/xvds", "/dev/xvdt", "/dev/xvdu", "/dev/xvdv", "/dev/xvdw", "/dev/xvdx", "/dev/xvdy", "/dev/xvdz"]
}
variable "ebs_volume_type" {
type = string
description = "The type of EBS volume. Can be standard, gp2 or io1"
default = "gp2"
}
variable "ebs_volume_size" {
type = number
description = "Size of the EBS volume in gigabytes"
default = 10
}
variable "ebs_iops" {
type = number
description = "Amount of provisioned IOPS. This must be set with a volume_type of io1"
default = 0
}
variable "ebs_volume_count" {
type = number
description = "Count of EBS volumes that will be attached to the instance"
default = 0
}
variable "delete_on_termination" {
type = bool
description = "Whether the volume should be destroyed on instance termination"
default = true
}
variable "welcome_message" {
type = string
description = "Welcome message"
default = ""
}
variable "comparison_operator" {
type = string
description = "The arithmetic operation to use when comparing the specified Statistic and Threshold. Possible values are: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold"
default = "GreaterThanOrEqualToThreshold"
}
variable "metric_name" {
type = string
description = "The name for the alarm's associated metric. Allowed values can be found in https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ec2-metricscollected.html"
default = "StatusCheckFailed_Instance"
}
variable "evaluation_periods" {
type = number
description = "The number of periods over which data is compared to the specified threshold"
default = 5
}
variable "metric_namespace" {
type = string
description = "The namespace for the alarm's associated metric. Allowed values can be found in https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-namespaces.html"
default = "AWS/EC2"
}
variable "applying_period" {
type = number
description = "The period in seconds over which the specified statistic is applied"
default = 60
}
variable "statistic_level" {
type = string
description = "The statistic to apply to the alarm's associated metric. Allowed values are: SampleCount, Average, Sum, Minimum, Maximum"
default = "Maximum"
}
variable "metric_threshold" {
type = number
description = "The value against which the specified statistic is compared"
default = 1
}
variable "default_alarm_action" {
type = string
description = "Default alarm action"
default = "action/actions/AWS_EC2.InstanceId.Reboot/1.0"
}
variable "create_default_security_group" {
type = bool
description = "Create default Security Group with only Egress traffic allowed"
default = true
}
variable "additional_ips_count" {
type = number
description = "Count of additional EIPs"
default = 0
}
variable "instance_count" {
type = number
description = "Count of ec2 instances to create"
default = 1
}
variable "permissions_boundary_arn" {
type = string
description = "Policy ARN to attach to instance role as a permissions boundary"
default = ""
}
variable "root_block_device_encrypted" {
type = bool
default = true
description = "Whether to encrypt the root block device"
}
variable "metadata_http_tokens_required" {
type = bool
default = true
description = "Whether or not the metadata service requires session tokens, also referred to as Instance Metadata Service Version 2."
}
variable "metadata_http_endpoint_enabled" {
type = bool
default = true
description = "Whether the metadata service is available"
}
variable "kms_key_id" {
type = string
default = null
description = "KMS key ID used to encrypt EBS volume. When specifying kms_key_id, ebs_volume_encrypted needs to be set to true"
}
variable "ebs_volume_encrypted" {
type = bool
description = "Size of the EBS volume in gigabytes"
default = true
}