forked from terraform-aws-modules/terraform-aws-autoscaling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
323 lines (270 loc) · 10.8 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
320
321
322
variable "create_lc" {
description = "Whether to create launch configuration"
type = bool
default = true
}
variable "create_asg" {
description = "Whether to create autoscaling group"
type = bool
default = true
}
variable "create_asg_with_initial_lifecycle_hook" {
description = "Create an ASG with initial lifecycle hook"
type = bool
default = false
}
variable "initial_lifecycle_hook_name" {
description = "The name of initial lifecycle hook"
type = string
default = ""
}
variable "initial_lifecycle_hook_lifecycle_transition" {
description = "The instance state to which you want to attach the initial lifecycle hook"
type = string
default = ""
}
variable "initial_lifecycle_hook_default_result" {
description = "Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON"
type = string
default = "ABANDON"
}
variable "initial_lifecycle_hook_notification_metadata" {
description = "Contains additional information that you want to include any time Auto Scaling sends a message to the notification target"
type = string
default = ""
}
variable "initial_lifecycle_hook_heartbeat_timeout" {
description = "Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the DefaultResult parameter"
type = string
default = "60"
}
variable "initial_lifecycle_hook_notification_target_arn" {
description = "The ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic"
type = string
default = ""
}
variable "initial_lifecycle_hook_role_arn" {
description = "The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target"
type = string
default = ""
}
variable "recreate_asg_when_lc_changes" {
description = "Whether to recreate an autoscaling group when launch configuration changes"
type = bool
default = false
}
variable "name" {
description = "Creates a unique name beginning with the specified prefix"
type = string
}
variable "lc_name" {
description = "Creates a unique name for launch configuration beginning with the specified prefix"
type = string
default = ""
}
variable "asg_name" {
description = "Creates a unique name for autoscaling group beginning with the specified prefix"
type = string
default = ""
}
variable "launch_configuration" {
description = "The name of the launch configuration to use (if it is created outside of this module)"
type = string
default = ""
}
# Launch configuration
variable "image_id" {
description = "The EC2 image ID to launch"
type = string
default = ""
}
variable "instance_type" {
description = "The size of instance to launch"
type = string
default = ""
}
variable "iam_instance_profile" {
description = "The IAM instance profile to associate with launched instances"
type = string
default = ""
}
variable "key_name" {
description = "The key name that should be used for the instance"
type = string
default = ""
}
variable "security_groups" {
description = "A list of security group IDs to assign to the launch configuration"
type = list(string)
default = []
}
variable "associate_public_ip_address" {
description = "Associate a public ip address with an instance in a VPC"
type = bool
default = false
}
variable "user_data" {
description = "The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see user_data_base64 instead."
type = string
default = null
}
variable "user_data_base64" {
description = "Can be used instead of user_data to pass base64-encoded binary data directly. Use this instead of user_data whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption."
type = string
default = null
}
variable "enable_monitoring" {
description = "Enables/disables detailed monitoring. This is enabled by default."
type = bool
default = true
}
variable "ebs_optimized" {
description = "If true, the launched EC2 instance will be EBS-optimized"
type = bool
default = false
}
variable "root_block_device" {
description = "Customize details about the root block device of the instance"
type = list(map(string))
default = []
}
variable "ebs_block_device" {
description = "Additional EBS block devices to attach to the instance"
type = list(map(string))
default = []
}
variable "ephemeral_block_device" {
description = "Customize Ephemeral (also known as 'Instance Store') volumes on the instance"
type = list(map(string))
default = []
}
variable "spot_price" {
description = "The price to use for reserving spot instances"
type = string
default = ""
}
variable "placement_tenancy" {
description = "The tenancy of the instance. Valid values are 'default' or 'dedicated'"
type = string
default = "default"
}
# Autoscaling group
variable "max_size" {
description = "The maximum size of the auto scale group"
type = string
}
variable "min_size" {
description = "The minimum size of the auto scale group"
type = string
}
variable "desired_capacity" {
description = "The number of Amazon EC2 instances that should be running in the group"
type = string
}
variable "vpc_zone_identifier" {
description = "A list of subnet IDs to launch resources in"
type = list(string)
}
variable "default_cooldown" {
description = "The amount of time, in seconds, after a scaling activity completes before another scaling activity can start"
type = number
default = 300
}
variable "health_check_grace_period" {
description = "Time (in seconds) after instance comes into service before checking health"
type = number
default = 300
}
variable "health_check_type" {
description = "Controls how health checking is done. Values are - EC2 and ELB"
type = string
}
variable "force_delete" {
description = "Allows deleting the autoscaling group without waiting for all instances in the pool to terminate. You can force an autoscaling group to delete even if it's in the process of scaling a resource. Normally, Terraform drains all the instances before deleting the group. This bypasses that behavior and potentially leaves resources dangling"
type = bool
default = false
}
variable "load_balancers" {
description = "A list of elastic load balancer names to add to the autoscaling group names"
type = list(string)
default = []
}
variable "target_group_arns" {
description = "A list of aws_alb_target_group ARNs, for use with Application Load Balancing"
type = list(string)
default = []
}
variable "termination_policies" {
description = "A list of policies to decide how the instances in the auto scale group should be terminated. The allowed values are OldestInstance, NewestInstance, OldestLaunchConfiguration, ClosestToNextInstanceHour, Default"
type = list(string)
default = ["Default"]
}
variable "suspended_processes" {
description = "A list of processes to suspend for the AutoScaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your autoscaling group from functioning properly."
type = list(string)
default = []
}
variable "tags" {
description = "A list of tag blocks. Each element should have keys named key, value, and propagate_at_launch."
type = list(map(string))
default = []
}
variable "tags_as_map" {
description = "A map of tags and values in the same format as other resources accept. This will be converted into the non-standard format that the aws_autoscaling_group requires."
type = map(string)
default = {}
}
variable "placement_group" {
description = "The name of the placement group into which you'll launch your instances, if any"
type = string
default = ""
}
variable "metrics_granularity" {
description = "The granularity to associate with the metrics to collect. The only valid value is 1Minute"
type = string
default = "1Minute"
}
variable "enabled_metrics" {
description = "A list of metrics to collect. The allowed values are GroupMinSize, GroupMaxSize, GroupDesiredCapacity, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupTerminatingInstances, GroupTotalInstances"
type = list(string)
default = [
"GroupMinSize",
"GroupMaxSize",
"GroupDesiredCapacity",
"GroupInServiceInstances",
"GroupPendingInstances",
"GroupStandbyInstances",
"GroupTerminatingInstances",
"GroupTotalInstances",
]
}
variable "wait_for_capacity_timeout" {
description = "A maximum duration that Terraform should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to '0' causes Terraform to skip all Capacity Waiting behavior."
type = string
default = "10m"
}
variable "min_elb_capacity" {
description = "Setting this causes Terraform to wait for this number of instances to show up healthy in the ELB only on creation. Updates will not wait on ELB instance number changes"
type = number
default = 0
}
variable "wait_for_elb_capacity" {
description = "Setting this will cause Terraform to wait for exactly this number of healthy instances in all attached load balancers on both create and update operations. Takes precedence over min_elb_capacity behavior."
type = number
default = null
}
variable "protect_from_scale_in" {
description = "Allows setting instance protection. The autoscaling group will not select instances with this setting for termination during scale in events."
type = bool
default = false
}
variable "service_linked_role_arn" {
description = "The ARN of the service-linked role that the ASG will use to call other AWS services."
type = string
default = ""
}
variable "max_instance_lifetime" {
description = "The maximum amount of time, in seconds, that an instance can be in service, values must be either equal to 0 or between 604800 and 31536000 seconds."
type = number
default = 0
}