forked from LeanerCloud/terraform-aws-autospotting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
217 lines (184 loc) · 5.73 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
# Autospotting configuration
variable "autospotting_allowed_instance_types" {
description = <<EOF
Comma separated list of allowed instance types for spot requests,
in case you want to exclude specific types (also support globs).
Example: 't2.*,m4.large'
Using the 'current' magic value will only allow the same type as the
on-demand instances set in the group's launch configuration.
EOF
default = ""
}
variable "autospotting_disallowed_instance_types" {
description = <<EOF
Comma separated list of disallowed instance types for spot requests,
in case you want to exclude specific types (also support globs).
Example: 't2.*,m4.large'
EOF
default = ""
}
variable "autospotting_instance_termination_method" {
description = <<EOF
Instance termination method. Must be one of 'autoscaling' (default) or
'detach' (compatibility mode, not recommended).
EOF
default = "autoscaling"
}
variable "autospotting_min_on_demand_number" {
description = "Minimum on-demand instances to keep in absolute value"
default = "0"
}
variable "autospotting_min_on_demand_percentage" {
description = "Minimum on-demand instances to keep in percentage"
default = "0.0"
}
variable "autospotting_on_demand_price_multiplier" {
description = "Multiplier for the on-demand price"
default = "1.0"
}
variable "autospotting_spot_product_description" {
description = <<EOF
The Spot Product or operating system to use when looking
up spot price history in the market.
Valid choices
- Linux/UNIX | SUSE Linux | Windows
- Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)
EOF
default = "Linux/UNIX (Amazon VPC)"
}
variable "autospotting_spot_price_buffer_percentage" {
description = "Percentage above the current spot price to place the bid"
default = "10.0"
}
variable "autospotting_bidding_policy" {
description = "Bidding policy for the spot bid"
default = "normal"
}
variable "autospotting_regions_enabled" {
description = "Regions in which autospotting is enabled"
default = ""
}
variable "autospotting_tag_filters" {
description = <<EOF
Tags to filter which ASGs autospotting considers. If blank
by default this will search for asgs with spot-enabled=true (when in opt-in
mode) and will skip those tagged with spot-enabled=false when in opt-out
mode.
You can set this to many tags, for example:
spot-enabled=true,Environment=dev,Team=vision
EOF
default = ""
}
variable "autospotting_tag_filtering_mode" {
description = <<EOF
Controls the tag-based ASG filter. Supported values: 'opt-in' or 'opt-out'.
Defaults to opt-in mode, in which it only acts against the tagged groups. In
opt-out mode it works against all groups except for the tagged ones.
EOF
default = "opt-in"
}
variable "autospotting_license" {
description = <<EOF
Autospotting License code. Allowed options are:
'evaluation', 'I_am_supporting_it_on_Patreon',
'I_contributed_to_development_within_the_last_year',
'I_built_it_from_source_code'
EOF
default = "evaluation"
}
# Lambda configuration
variable "lambda_zipname" {
description = "Name of the archive, relative to the module"
default = null
}
variable "lambda_s3_bucket" {
description = "Bucket which the archive is stored in"
default = "cloudprowess"
}
variable "lambda_s3_key" {
description = "Key in S3 under which the archive is stored"
default = "nightly/lambda.zip"
}
variable "lambda_runtime" {
description = "Environment the lambda function runs in"
default = "go1.x"
}
variable "lambda_memory_size" {
description = "Memory size allocated to the lambda run"
default = 1024
}
variable "lambda_timeout" {
description = "Timeout after which the lambda timeout"
default = 300
}
variable "lambda_run_frequency" {
description = "How frequent should lambda run"
default = "rate(5 minutes)"
}
variable "lambda_tags" {
description = "Tags to be applied to the Lambda function"
default = {
# You can add more values below
Name = "autospotting"
}
}
# Label configuration
variable "label_context" {
description = "Used to pass in label module context"
type = object({
namespace = string
environment = string
stage = string
name = string
enabled = bool
delimiter = string
attributes = list(string)
label_order = list(string)
tags = map(string)
additional_tag_map = map(string)
regex_replace_chars = string
})
default = {
namespace = ""
environment = ""
stage = ""
name = ""
enabled = true
delimiter = ""
attributes = []
label_order = []
tags = {}
additional_tag_map = {}
regex_replace_chars = ""
}
}
variable "label_namespace" {
description = "Namespace, which could be your organization name or abbreviation"
default = ""
}
variable "label_environment" {
description = "Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT'"
default = ""
}
variable "label_stage" {
description = "Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release'"
default = ""
}
variable "label_name" {
description = "Solution name, e.g. 'autospotting' or 'autospotting-storage-optimized'"
default = "autospotting"
}
variable "label_attributes" {
type = list(string)
description = "Additional attributes (e.g. 1)"
default = []
}
variable "label_tags" {
description = "Additional tags (e.g. map('BusinessUnit','XYZ')"
type = map(string)
default = {}
}
variable "label_delimiter" {
description = "Delimiter to be used between namespace, environment, stage, name and attributes"
default = "-"
}