`,
17 | # with final values filled in.
18 | #
19 | # For example, when using defaults, `module.this.context.delimiter`
20 | # will be null, and `module.this.delimiter` will be `-` (hyphen).
21 | #
22 |
23 | module "this" {
24 | source = "cloudposse/label/null"
25 | version = "0.25.0" # requires Terraform >= 0.13.0
26 |
27 | enabled = var.enabled
28 | namespace = var.namespace
29 | tenant = var.tenant
30 | environment = var.environment
31 | stage = var.stage
32 | name = var.name
33 | delimiter = var.delimiter
34 | attributes = var.attributes
35 | tags = var.tags
36 | additional_tag_map = var.additional_tag_map
37 | label_order = var.label_order
38 | regex_replace_chars = var.regex_replace_chars
39 | id_length_limit = var.id_length_limit
40 | label_key_case = var.label_key_case
41 | label_value_case = var.label_value_case
42 | descriptor_formats = var.descriptor_formats
43 | labels_as_tags = var.labels_as_tags
44 |
45 | context = var.context
46 | }
47 |
48 | # Copy contents of cloudposse/terraform-null-label/variables.tf here
49 |
50 | variable "context" {
51 | type = any
52 | default = {
53 | enabled = true
54 | namespace = null
55 | tenant = null
56 | environment = null
57 | stage = null
58 | name = null
59 | delimiter = null
60 | attributes = []
61 | tags = {}
62 | additional_tag_map = {}
63 | regex_replace_chars = null
64 | label_order = []
65 | id_length_limit = null
66 | label_key_case = null
67 | label_value_case = null
68 | descriptor_formats = {}
69 | # Note: we have to use [] instead of null for unset lists due to
70 | # https://github.com/hashicorp/terraform/issues/28137
71 | # which was not fixed until Terraform 1.0.0,
72 | # but we want the default to be all the labels in `label_order`
73 | # and we want users to be able to prevent all tag generation
74 | # by setting `labels_as_tags` to `[]`, so we need
75 | # a different sentinel to indicate "default"
76 | labels_as_tags = ["unset"]
77 | }
78 | description = <<-EOT
79 | Single object for setting entire context at once.
80 | See description of individual variables for details.
81 | Leave string and numeric variables as `null` to use default value.
82 | Individual variable settings (non-null) override settings in context object,
83 | except for attributes, tags, and additional_tag_map, which are merged.
84 | EOT
85 |
86 | validation {
87 | condition = lookup(var.context, "label_key_case", null) == null ? true : contains(["lower", "title", "upper"], var.context["label_key_case"])
88 | error_message = "Allowed values: `lower`, `title`, `upper`."
89 | }
90 |
91 | validation {
92 | condition = lookup(var.context, "label_value_case", null) == null ? true : contains(["lower", "title", "upper", "none"], var.context["label_value_case"])
93 | error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
94 | }
95 | }
96 |
97 | variable "enabled" {
98 | type = bool
99 | default = null
100 | description = "Set to false to prevent the module from creating any resources"
101 | }
102 |
103 | variable "namespace" {
104 | type = string
105 | default = null
106 | description = "ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique"
107 | }
108 |
109 | variable "tenant" {
110 | type = string
111 | default = null
112 | description = "ID element _(Rarely used, not included by default)_. A customer identifier, indicating who this instance of a resource is for"
113 | }
114 |
115 | variable "environment" {
116 | type = string
117 | default = null
118 | description = "ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT'"
119 | }
120 |
121 | variable "stage" {
122 | type = string
123 | default = null
124 | description = "ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release'"
125 | }
126 |
127 | variable "name" {
128 | type = string
129 | default = null
130 | description = <<-EOT
131 | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
132 | This is the only ID element not also included as a `tag`.
133 | The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input.
134 | EOT
135 | }
136 |
137 | variable "delimiter" {
138 | type = string
139 | default = null
140 | description = <<-EOT
141 | Delimiter to be used between ID elements.
142 | Defaults to `-` (hyphen). Set to `""` to use no delimiter at all.
143 | EOT
144 | }
145 |
146 | variable "attributes" {
147 | type = list(string)
148 | default = []
149 | description = <<-EOT
150 | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
151 | in the order they appear in the list. New attributes are appended to the
152 | end of the list. The elements of the list are joined by the `delimiter`
153 | and treated as a single ID element.
154 | EOT
155 | }
156 |
157 | variable "labels_as_tags" {
158 | type = set(string)
159 | default = ["default"]
160 | description = <<-EOT
161 | Set of labels (ID elements) to include as tags in the `tags` output.
162 | Default is to include all labels.
163 | Tags with empty values will not be included in the `tags` output.
164 | Set to `[]` to suppress all generated tags.
165 | **Notes:**
166 | The value of the `name` tag, if included, will be the `id`, not the `name`.
167 | Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be
168 | changed in later chained modules. Attempts to change it will be silently ignored.
169 | EOT
170 | }
171 |
172 | variable "tags" {
173 | type = map(string)
174 | default = {}
175 | description = <<-EOT
176 | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
177 | Neither the tag keys nor the tag values will be modified by this module.
178 | EOT
179 | }
180 |
181 | variable "additional_tag_map" {
182 | type = map(string)
183 | default = {}
184 | description = <<-EOT
185 | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
186 | This is for some rare cases where resources want additional configuration of tags
187 | and therefore take a list of maps with tag key, value, and additional configuration.
188 | EOT
189 | }
190 |
191 | variable "label_order" {
192 | type = list(string)
193 | default = null
194 | description = <<-EOT
195 | The order in which the labels (ID elements) appear in the `id`.
196 | Defaults to ["namespace", "environment", "stage", "name", "attributes"].
197 | You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present.
198 | EOT
199 | }
200 |
201 | variable "regex_replace_chars" {
202 | type = string
203 | default = null
204 | description = <<-EOT
205 | Terraform regular expression (regex) string.
206 | Characters matching the regex will be removed from the ID elements.
207 | If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits.
208 | EOT
209 | }
210 |
211 | variable "id_length_limit" {
212 | type = number
213 | default = null
214 | description = <<-EOT
215 | Limit `id` to this many characters (minimum 6).
216 | Set to `0` for unlimited length.
217 | Set to `null` for keep the existing setting, which defaults to `0`.
218 | Does not affect `id_full`.
219 | EOT
220 | validation {
221 | condition = var.id_length_limit == null ? true : var.id_length_limit >= 6 || var.id_length_limit == 0
222 | error_message = "The id_length_limit must be >= 6 if supplied (not null), or 0 for unlimited length."
223 | }
224 | }
225 |
226 | variable "label_key_case" {
227 | type = string
228 | default = null
229 | description = <<-EOT
230 | Controls the letter case of the `tags` keys (label names) for tags generated by this module.
231 | Does not affect keys of tags passed in via the `tags` input.
232 | Possible values: `lower`, `title`, `upper`.
233 | Default value: `title`.
234 | EOT
235 |
236 | validation {
237 | condition = var.label_key_case == null ? true : contains(["lower", "title", "upper"], var.label_key_case)
238 | error_message = "Allowed values: `lower`, `title`, `upper`."
239 | }
240 | }
241 |
242 | variable "label_value_case" {
243 | type = string
244 | default = null
245 | description = <<-EOT
246 | Controls the letter case of ID elements (labels) as included in `id`,
247 | set as tag values, and output by this module individually.
248 | Does not affect values of tags passed in via the `tags` input.
249 | Possible values: `lower`, `title`, `upper` and `none` (no transformation).
250 | Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.
251 | Default value: `lower`.
252 | EOT
253 |
254 | validation {
255 | condition = var.label_value_case == null ? true : contains(["lower", "title", "upper", "none"], var.label_value_case)
256 | error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
257 | }
258 | }
259 |
260 | variable "descriptor_formats" {
261 | type = any
262 | default = {}
263 | description = <<-EOT
264 | Describe additional descriptors to be output in the `descriptors` output map.
265 | Map of maps. Keys are names of descriptors. Values are maps of the form
266 | `{
267 | format = string
268 | labels = list(string)
269 | }`
270 | (Type is `any` so the map values can later be enhanced to provide additional options.)
271 | `format` is a Terraform format string to be passed to the `format()` function.
272 | `labels` is a list of labels, in order, to pass to `format()` function.
273 | Label values will be normalized before being passed to `format()` so they will be
274 | identical to how they appear in `id`.
275 | Default is `{}` (`descriptors` output will be empty).
276 | EOT
277 | }
278 |
279 | #### End of copy of cloudposse/terraform-null-label/variables.tf
280 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2018-2020 Cloud Posse, LLC
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/variables.tf:
--------------------------------------------------------------------------------
1 | variable "image_id" {
2 | type = string
3 | description = "The EC2 image ID to launch"
4 | default = ""
5 | }
6 |
7 | variable "instance_initiated_shutdown_behavior" {
8 | type = string
9 | description = "Shutdown behavior for the instances. Can be `stop` or `terminate`"
10 | default = "terminate"
11 | }
12 |
13 | variable "instance_type" {
14 | type = string
15 | description = "Instance type to launch"
16 | }
17 |
18 | variable "iam_instance_profile_name" {
19 | type = string
20 | description = "The IAM instance profile name to associate with launched instances"
21 | default = ""
22 | }
23 |
24 | variable "key_name" {
25 | type = string
26 | description = "The SSH key name that should be used for the instance"
27 | default = ""
28 | }
29 |
30 | variable "security_group_ids" {
31 | description = "A list of associated security group IDs"
32 | type = list(string)
33 | default = []
34 | }
35 |
36 | variable "launch_template_version" {
37 | type = string
38 | description = "Launch template version. Can be version number, `$Latest` or `$Default`"
39 | default = "$Latest"
40 | }
41 |
42 | variable "associate_public_ip_address" {
43 | type = bool
44 | description = "Associate a public IP address with an instance in a VPC"
45 | default = false
46 | }
47 |
48 | variable "user_data_base64" {
49 | type = string
50 | description = "The Base64-encoded user data to provide when launching the instances"
51 | default = ""
52 | }
53 |
54 | variable "enable_monitoring" {
55 | type = bool
56 | description = "Enable/disable detailed monitoring"
57 | default = true
58 | }
59 |
60 | variable "update_default_version" {
61 | type = bool
62 | description = "Whether to update Default version of Launch template each update"
63 | default = false
64 | }
65 |
66 | variable "ebs_optimized" {
67 | type = bool
68 | description = "If true, the launched EC2 instance will be EBS-optimized"
69 | default = false
70 | }
71 |
72 | variable "block_device_mappings" {
73 | description = "Specify volumes to attach to the instance besides the volumes specified by the AMI"
74 |
75 | type = list(object({
76 | device_name = string
77 | no_device = bool
78 | virtual_name = string
79 | ebs = object({
80 | delete_on_termination = bool
81 | encrypted = bool
82 | iops = number
83 | kms_key_id = string
84 | snapshot_id = string
85 | volume_size = number
86 | volume_type = string
87 | })
88 | }))
89 |
90 | default = []
91 | }
92 |
93 | variable "instance_market_options" {
94 | description = "The market (purchasing) option for the instances"
95 |
96 | type = object({
97 | market_type = string
98 | spot_options = object({
99 | block_duration_minutes = number
100 | instance_interruption_behavior = string
101 | max_price = number
102 | spot_instance_type = string
103 | valid_until = string
104 | })
105 | })
106 |
107 | default = null
108 | }
109 |
110 | variable "instance_refresh" {
111 | description = "The instance refresh definition"
112 | type = object({
113 | strategy = string
114 | preferences = object({
115 | instance_warmup = number
116 | min_healthy_percentage = number
117 | })
118 | triggers = list(string)
119 | })
120 |
121 | default = null
122 | }
123 |
124 | variable "mixed_instances_policy" {
125 | description = "policy to used mixed group of on demand/spot of differing types. Launch template is automatically generated. https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#mixed_instances_policy-1"
126 |
127 | type = object({
128 | instances_distribution = object({
129 | on_demand_allocation_strategy = string
130 | on_demand_base_capacity = number
131 | on_demand_percentage_above_base_capacity = number
132 | spot_allocation_strategy = string
133 | spot_instance_pools = number
134 | spot_max_price = string
135 | })
136 | override = list(object({
137 | instance_type = string
138 | weighted_capacity = number
139 | }))
140 | })
141 | default = null
142 | }
143 |
144 | variable "placement" {
145 | description = "The placement specifications of the instances"
146 |
147 | type = object({
148 | affinity = string
149 | availability_zone = string
150 | group_name = string
151 | host_id = string
152 | tenancy = string
153 | })
154 |
155 | default = null
156 | }
157 |
158 | variable "credit_specification" {
159 | description = "Customize the credit specification of the instances"
160 |
161 | type = object({
162 | cpu_credits = string
163 | })
164 |
165 | default = null
166 | }
167 |
168 | variable "elastic_gpu_specifications" {
169 | description = "Specifications of Elastic GPU to attach to the instances"
170 |
171 | type = object({
172 | type = string
173 | })
174 |
175 | default = null
176 | }
177 |
178 | variable "disable_api_termination" {
179 | type = bool
180 | description = "If `true`, enables EC2 Instance Termination Protection"
181 | default = false
182 | }
183 |
184 | variable "max_size" {
185 | type = number
186 | description = "The maximum size of the autoscale group"
187 | }
188 |
189 | variable "min_size" {
190 | type = number
191 | description = "The minimum size of the autoscale group"
192 | }
193 |
194 | variable "subnet_ids" {
195 | description = "A list of subnet IDs to launch resources in"
196 | type = list(string)
197 | }
198 |
199 | variable "default_cooldown" {
200 | type = number
201 | description = "The amount of time, in seconds, after a scaling activity completes before another scaling activity can start"
202 | default = 300
203 | }
204 |
205 | variable "health_check_grace_period" {
206 | type = number
207 | description = "Time (in seconds) after instance comes into service before checking health"
208 | default = 300
209 | }
210 |
211 | variable "health_check_type" {
212 | type = string
213 | description = "Controls how health checking is done. Valid values are `EC2` or `ELB`"
214 | default = "EC2"
215 | }
216 |
217 | variable "force_delete" {
218 | type = bool
219 | 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"
220 | default = false
221 | }
222 |
223 | variable "load_balancers" {
224 | type = list(string)
225 | description = "A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use `target_group_arns` instead"
226 | default = []
227 | }
228 |
229 | variable "target_group_arns" {
230 | type = list(string)
231 | description = "A list of aws_alb_target_group ARNs, for use with Application Load Balancing"
232 | default = []
233 | }
234 |
235 | variable "termination_policies" {
236 | 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`"
237 | type = list(string)
238 | default = ["Default"]
239 | }
240 |
241 | variable "suspended_processes" {
242 | type = list(string)
243 | 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."
244 | default = []
245 | }
246 |
247 | variable "placement_group" {
248 | type = string
249 | description = "The name of the placement group into which you'll launch your instances, if any"
250 | default = ""
251 | }
252 |
253 | variable "metrics_granularity" {
254 | type = string
255 | description = "The granularity to associate with the metrics to collect. The only valid value is 1Minute"
256 | default = "1Minute"
257 | }
258 |
259 | variable "enabled_metrics" {
260 | description = "A list of metrics to collect. The allowed values are `GroupMinSize`, `GroupMaxSize`, `GroupDesiredCapacity`, `GroupInServiceInstances`, `GroupPendingInstances`, `GroupStandbyInstances`, `GroupTerminatingInstances`, `GroupTotalInstances`"
261 | type = list(string)
262 |
263 | default = [
264 | "GroupMinSize",
265 | "GroupMaxSize",
266 | "GroupDesiredCapacity",
267 | "GroupInServiceInstances",
268 | "GroupPendingInstances",
269 | "GroupStandbyInstances",
270 | "GroupTerminatingInstances",
271 | "GroupTotalInstances",
272 | ]
273 | }
274 |
275 | variable "wait_for_capacity_timeout" {
276 | type = string
277 | description = "A maximum duration that Terraform should wait for ASG instances to be healthy before timing out. Setting this to '0' causes Terraform to skip all Capacity Waiting behavior"
278 | default = "10m"
279 | }
280 |
281 | variable "min_elb_capacity" {
282 | type = number
283 | 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"
284 | default = 0
285 | }
286 |
287 | variable "wait_for_elb_capacity" {
288 | type = number
289 | 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"
290 | default = 0
291 | }
292 |
293 | variable "protect_from_scale_in" {
294 | type = bool
295 | description = "Allows setting instance protection. The autoscaling group will not select instances with this setting for terminination during scale in events"
296 | default = false
297 | }
298 |
299 | variable "service_linked_role_arn" {
300 | type = string
301 | description = "The ARN of the service-linked role that the ASG will use to call other AWS services"
302 | default = ""
303 | }
304 |
305 | variable "autoscaling_policies_enabled" {
306 | type = bool
307 | default = true
308 | description = "Whether to create `aws_autoscaling_policy` and `aws_cloudwatch_metric_alarm` resources to control Auto Scaling"
309 | }
310 |
311 | variable "scale_up_cooldown_seconds" {
312 | type = number
313 | default = 300
314 | description = "The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start"
315 | }
316 |
317 | variable "scale_up_scaling_adjustment" {
318 | type = number
319 | default = 1
320 | description = "The number of instances by which to scale. `scale_up_adjustment_type` determines the interpretation of this number (e.g. as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity"
321 | }
322 |
323 | variable "scale_up_adjustment_type" {
324 | type = string
325 | default = "ChangeInCapacity"
326 | description = "Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity` and `PercentChangeInCapacity`"
327 | }
328 |
329 | variable "scale_up_policy_type" {
330 | type = string
331 | default = "SimpleScaling"
332 | description = "The scaling policy type. Currently only `SimpleScaling` is supported"
333 | }
334 |
335 | variable "scale_down_cooldown_seconds" {
336 | type = number
337 | default = 300
338 | description = "The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start"
339 | }
340 |
341 | variable "scale_down_scaling_adjustment" {
342 | type = number
343 | default = -1
344 | description = "The number of instances by which to scale. `scale_down_scaling_adjustment` determines the interpretation of this number (e.g. as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity"
345 | }
346 |
347 | variable "scale_down_adjustment_type" {
348 | type = string
349 | default = "ChangeInCapacity"
350 | description = "Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity` and `PercentChangeInCapacity`"
351 | }
352 |
353 | variable "scale_down_policy_type" {
354 | type = string
355 | default = "SimpleScaling"
356 | description = "The scaling policy type. Currently only `SimpleScaling` is supported"
357 | }
358 |
359 | variable "cpu_utilization_high_evaluation_periods" {
360 | type = number
361 | default = 2
362 | description = "The number of periods over which data is compared to the specified threshold"
363 | }
364 |
365 | variable "cpu_utilization_high_period_seconds" {
366 | type = number
367 | default = 300
368 | description = "The period in seconds over which the specified statistic is applied"
369 | }
370 |
371 | variable "cpu_utilization_high_threshold_percent" {
372 | type = number
373 | default = 90
374 | description = "The value against which the specified statistic is compared"
375 | }
376 |
377 | variable "cpu_utilization_high_statistic" {
378 | type = string
379 | default = "Average"
380 | description = "The statistic to apply to the alarm's associated metric. Either of the following is supported: `SampleCount`, `Average`, `Sum`, `Minimum`, `Maximum`"
381 | }
382 |
383 | variable "cpu_utilization_low_evaluation_periods" {
384 | type = number
385 | default = 2
386 | description = "The number of periods over which data is compared to the specified threshold"
387 | }
388 |
389 | variable "cpu_utilization_low_period_seconds" {
390 | type = number
391 | default = 300
392 | description = "The period in seconds over which the specified statistic is applied"
393 | }
394 |
395 | variable "cpu_utilization_low_threshold_percent" {
396 | type = number
397 | default = 10
398 | description = "The value against which the specified statistic is compared"
399 | }
400 |
401 | variable "cpu_utilization_low_statistic" {
402 | type = string
403 | default = "Average"
404 | description = "The statistic to apply to the alarm's associated metric. Either of the following is supported: `SampleCount`, `Average`, `Sum`, `Minimum`, `Maximum`"
405 | }
406 |
407 | variable "desired_capacity" {
408 | type = number
409 | description = "The number of Amazon EC2 instances that should be running in the group, if not set will use `min_size` as value"
410 | default = null
411 | }
412 |
413 | variable "default_alarms_enabled" {
414 | type = bool
415 | default = true
416 | description = "Enable or disable cpu and memory Cloudwatch alarms"
417 | }
418 |
419 | variable "custom_alarms" {
420 | type = map(object({
421 | alarm_name = string
422 | comparison_operator = string
423 | evaluation_periods = string
424 | metric_name = string
425 | namespace = string
426 | period = string
427 | statistic = string
428 | threshold = string
429 | treat_missing_data = string
430 | ok_actions = list(string)
431 | insufficient_data_actions = list(string)
432 | dimensions_name = string
433 | dimensions_target = string
434 | alarm_description = string
435 | alarm_actions = list(string)
436 | }))
437 | default = {}
438 | description = "Map of custom CloudWatch alarms configurations"
439 | }
440 |
441 | variable "metadata_http_endpoint_enabled" {
442 | type = bool
443 | default = true
444 | description = "Set false to disable the Instance Metadata Service."
445 | }
446 |
447 | variable "metadata_http_put_response_hop_limit" {
448 | type = number
449 | default = 2
450 | description = <<-EOT
451 | The desired HTTP PUT response hop limit (between 1 and 64) for Instance Metadata Service requests.
452 | The default is `2` to support containerized workloads.
453 | EOT
454 | }
455 |
456 | variable "metadata_http_tokens_required" {
457 | type = bool
458 | default = true
459 | description = "Set true to require IMDS session tokens, disabling Instance Metadata Service Version 1."
460 | }
461 |
462 | variable "metadata_http_protocol_ipv6_enabled" {
463 | type = bool
464 | default = false
465 | description = "Set true to enable IPv6 in the launch template."
466 | }
467 |
468 |
469 | variable "metadata_instance_metadata_tags_enabled" {
470 | type = bool
471 | default = false
472 | description = "Set true to enable metadata tags in the launch template."
473 | }
474 | variable "tag_specifications_resource_types" {
475 | type = set(string)
476 | default = ["instance", "volume"]
477 | description = "List of tag specification resource types to tag. Valid values are instance, volume, elastic-gpu and spot-instances-request."
478 | }
479 |
480 | variable "max_instance_lifetime" {
481 | type = number
482 | default = null
483 | 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"
484 | }
485 |
486 | variable "capacity_rebalance" {
487 | type = bool
488 | default = false
489 | description = "Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled."
490 | }
491 |
492 | variable "warm_pool" {
493 | type = object({
494 | pool_state = string
495 | min_size = number
496 | max_group_prepared_capacity = number
497 | })
498 | description = "If this block is configured, add a Warm Pool to the specified Auto Scaling group. See [warm_pool](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#warm_pool)."
499 | default = null
500 | }
501 |
--------------------------------------------------------------------------------
/docs/terraform.md:
--------------------------------------------------------------------------------
1 |
2 | ## Requirements
3 |
4 | | Name | Version |
5 | |------|---------|
6 | | [terraform](#requirement\_terraform) | >= 0.13 |
7 | | [aws](#requirement\_aws) | >= 2.0 |
8 |
9 | ## Providers
10 |
11 | | Name | Version |
12 | |------|---------|
13 | | [aws](#provider\_aws) | >= 2.0 |
14 |
15 | ## Modules
16 |
17 | | Name | Source | Version |
18 | |------|--------|---------|
19 | | [this](#module\_this) | cloudposse/label/null | 0.25.0 |
20 |
21 | ## Resources
22 |
23 | | Name | Type |
24 | |------|------|
25 | | [aws_autoscaling_group.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group) | resource |
26 | | [aws_autoscaling_policy.scale_down](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_policy) | resource |
27 | | [aws_autoscaling_policy.scale_up](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_policy) | resource |
28 | | [aws_cloudwatch_metric_alarm.all_alarms](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm) | resource |
29 | | [aws_launch_template.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_template) | resource |
30 |
31 | ## Inputs
32 |
33 | | Name | Description | Type | Default | Required |
34 | |------|-------------|------|---------|:--------:|
35 | | [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
This is for some rare cases where resources want additional configuration of tags
and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
36 | | [associate\_public\_ip\_address](#input\_associate\_public\_ip\_address) | Associate a public IP address with an instance in a VPC | `bool` | `false` | no |
37 | | [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no |
38 | | [autoscaling\_policies\_enabled](#input\_autoscaling\_policies\_enabled) | Whether to create `aws_autoscaling_policy` and `aws_cloudwatch_metric_alarm` resources to control Auto Scaling | `bool` | `true` | no |
39 | | [block\_device\_mappings](#input\_block\_device\_mappings) | Specify volumes to attach to the instance besides the volumes specified by the AMI | list(object({
device_name = string
no_device = bool
virtual_name = string
ebs = object({
delete_on_termination = bool
encrypted = bool
iops = number
kms_key_id = string
snapshot_id = string
volume_size = number
volume_type = string
})
})) | `[]` | no |
40 | | [capacity\_rebalance](#input\_capacity\_rebalance) | Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled. | `bool` | `false` | no |
41 | | [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | {
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
} | no |
42 | | [cpu\_utilization\_high\_evaluation\_periods](#input\_cpu\_utilization\_high\_evaluation\_periods) | The number of periods over which data is compared to the specified threshold | `number` | `2` | no |
43 | | [cpu\_utilization\_high\_period\_seconds](#input\_cpu\_utilization\_high\_period\_seconds) | The period in seconds over which the specified statistic is applied | `number` | `300` | no |
44 | | [cpu\_utilization\_high\_statistic](#input\_cpu\_utilization\_high\_statistic) | The statistic to apply to the alarm's associated metric. Either of the following is supported: `SampleCount`, `Average`, `Sum`, `Minimum`, `Maximum` | `string` | `"Average"` | no |
45 | | [cpu\_utilization\_high\_threshold\_percent](#input\_cpu\_utilization\_high\_threshold\_percent) | The value against which the specified statistic is compared | `number` | `90` | no |
46 | | [cpu\_utilization\_low\_evaluation\_periods](#input\_cpu\_utilization\_low\_evaluation\_periods) | The number of periods over which data is compared to the specified threshold | `number` | `2` | no |
47 | | [cpu\_utilization\_low\_period\_seconds](#input\_cpu\_utilization\_low\_period\_seconds) | The period in seconds over which the specified statistic is applied | `number` | `300` | no |
48 | | [cpu\_utilization\_low\_statistic](#input\_cpu\_utilization\_low\_statistic) | The statistic to apply to the alarm's associated metric. Either of the following is supported: `SampleCount`, `Average`, `Sum`, `Minimum`, `Maximum` | `string` | `"Average"` | no |
49 | | [cpu\_utilization\_low\_threshold\_percent](#input\_cpu\_utilization\_low\_threshold\_percent) | The value against which the specified statistic is compared | `number` | `10` | no |
50 | | [credit\_specification](#input\_credit\_specification) | Customize the credit specification of the instances | object({
cpu_credits = string
}) | `null` | no |
51 | | [custom\_alarms](#input\_custom\_alarms) | Map of custom CloudWatch alarms configurations | map(object({
alarm_name = string
comparison_operator = string
evaluation_periods = string
metric_name = string
namespace = string
period = string
statistic = string
threshold = string
treat_missing_data = string
ok_actions = list(string)
insufficient_data_actions = list(string)
dimensions_name = string
dimensions_target = string
alarm_description = string
alarm_actions = list(string)
})) | `{}` | no |
52 | | [default\_alarms\_enabled](#input\_default\_alarms\_enabled) | Enable or disable cpu and memory Cloudwatch alarms | `bool` | `true` | no |
53 | | [default\_cooldown](#input\_default\_cooldown) | The amount of time, in seconds, after a scaling activity completes before another scaling activity can start | `number` | `300` | no |
54 | | [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
55 | | [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
56 | | [desired\_capacity](#input\_desired\_capacity) | The number of Amazon EC2 instances that should be running in the group, if not set will use `min_size` as value | `number` | `null` | no |
57 | | [disable\_api\_termination](#input\_disable\_api\_termination) | If `true`, enables EC2 Instance Termination Protection | `bool` | `false` | no |
58 | | [ebs\_optimized](#input\_ebs\_optimized) | If true, the launched EC2 instance will be EBS-optimized | `bool` | `false` | no |
59 | | [elastic\_gpu\_specifications](#input\_elastic\_gpu\_specifications) | Specifications of Elastic GPU to attach to the instances | object({
type = string
}) | `null` | no |
60 | | [enable\_monitoring](#input\_enable\_monitoring) | Enable/disable detailed monitoring | `bool` | `true` | no |
61 | | [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
62 | | [enabled\_metrics](#input\_enabled\_metrics) | A list of metrics to collect. The allowed values are `GroupMinSize`, `GroupMaxSize`, `GroupDesiredCapacity`, `GroupInServiceInstances`, `GroupPendingInstances`, `GroupStandbyInstances`, `GroupTerminatingInstances`, `GroupTotalInstances` | `list(string)` | [
"GroupMinSize",
"GroupMaxSize",
"GroupDesiredCapacity",
"GroupInServiceInstances",
"GroupPendingInstances",
"GroupStandbyInstances",
"GroupTerminatingInstances",
"GroupTotalInstances"
]
| no |
63 | | [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
64 | | [force\_delete](#input\_force\_delete) | 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 | `bool` | `false` | no |
65 | | [health\_check\_grace\_period](#input\_health\_check\_grace\_period) | Time (in seconds) after instance comes into service before checking health | `number` | `300` | no |
66 | | [health\_check\_type](#input\_health\_check\_type) | Controls how health checking is done. Valid values are `EC2` or `ELB` | `string` | `"EC2"` | no |
67 | | [iam\_instance\_profile\_name](#input\_iam\_instance\_profile\_name) | The IAM instance profile name to associate with launched instances | `string` | `""` | no |
68 | | [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).
Set to `0` for unlimited length.
Set to `null` for keep the existing setting, which defaults to `0`.
Does not affect `id_full`. | `number` | `null` | no |
69 | | [image\_id](#input\_image\_id) | The EC2 image ID to launch | `string` | `""` | no |
70 | | [instance\_initiated\_shutdown\_behavior](#input\_instance\_initiated\_shutdown\_behavior) | Shutdown behavior for the instances. Can be `stop` or `terminate` | `string` | `"terminate"` | no |
71 | | [instance\_market\_options](#input\_instance\_market\_options) | The market (purchasing) option for the instances | object({
market_type = string
spot_options = object({
block_duration_minutes = number
instance_interruption_behavior = string
max_price = number
spot_instance_type = string
valid_until = string
})
}) | `null` | no |
72 | | [instance\_refresh](#input\_instance\_refresh) | The instance refresh definition | object({
strategy = string
preferences = object({
instance_warmup = number
min_healthy_percentage = number
})
triggers = list(string)
}) | `null` | no |
73 | | [instance\_type](#input\_instance\_type) | Instance type to launch | `string` | n/a | yes |
74 | | [key\_name](#input\_key\_name) | The SSH key name that should be used for the instance | `string` | `""` | no |
75 | | [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.
Does not affect keys of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper`.
Default value: `title`. | `string` | `null` | no |
76 | | [label\_order](#input\_label\_order) | The order in which the labels (ID elements) appear in the `id`.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. | `list(string)` | `null` | no |
77 | | [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,
set as tag values, and output by this module individually.
Does not affect values of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.
Default value: `lower`. | `string` | `null` | no |
78 | | [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.
Default is to include all labels.
Tags with empty values will not be included in the `tags` output.
Set to `[]` to suppress all generated tags.
**Notes:**
The value of the `name` tag, if included, will be the `id`, not the `name`.
Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be
changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` | [
"default"
]
| no |
79 | | [launch\_template\_version](#input\_launch\_template\_version) | Launch template version. Can be version number, `$Latest` or `$Default` | `string` | `"$Latest"` | no |
80 | | [load\_balancers](#input\_load\_balancers) | A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use `target_group_arns` instead | `list(string)` | `[]` | no |
81 | | [max\_instance\_lifetime](#input\_max\_instance\_lifetime) | 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 | `number` | `null` | no |
82 | | [max\_size](#input\_max\_size) | The maximum size of the autoscale group | `number` | n/a | yes |
83 | | [metadata\_http\_endpoint\_enabled](#input\_metadata\_http\_endpoint\_enabled) | Set false to disable the Instance Metadata Service. | `bool` | `true` | no |
84 | | [metadata\_http\_protocol\_ipv6\_enabled](#input\_metadata\_http\_protocol\_ipv6\_enabled) | Set true to enable IPv6 in the launch template. | `bool` | `false` | no |
85 | | [metadata\_http\_put\_response\_hop\_limit](#input\_metadata\_http\_put\_response\_hop\_limit) | The desired HTTP PUT response hop limit (between 1 and 64) for Instance Metadata Service requests.
The default is `2` to support containerized workloads. | `number` | `2` | no |
86 | | [metadata\_http\_tokens\_required](#input\_metadata\_http\_tokens\_required) | Set true to require IMDS session tokens, disabling Instance Metadata Service Version 1. | `bool` | `true` | no |
87 | | [metadata\_instance\_metadata\_tags\_enabled](#input\_metadata\_instance\_metadata\_tags\_enabled) | Set true to enable metadata tags in the launch template. | `bool` | `false` | no |
88 | | [metrics\_granularity](#input\_metrics\_granularity) | The granularity to associate with the metrics to collect. The only valid value is 1Minute | `string` | `"1Minute"` | no |
89 | | [min\_elb\_capacity](#input\_min\_elb\_capacity) | 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 | `number` | `0` | no |
90 | | [min\_size](#input\_min\_size) | The minimum size of the autoscale group | `number` | n/a | yes |
91 | | [mixed\_instances\_policy](#input\_mixed\_instances\_policy) | policy to used mixed group of on demand/spot of differing types. Launch template is automatically generated. https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#mixed_instances_policy-1 | object({
instances_distribution = object({
on_demand_allocation_strategy = string
on_demand_base_capacity = number
on_demand_percentage_above_base_capacity = number
spot_allocation_strategy = string
spot_instance_pools = number
spot_max_price = string
})
override = list(object({
instance_type = string
weighted_capacity = number
}))
}) | `null` | no |
92 | | [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
This is the only ID element not also included as a `tag`.
The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
93 | | [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
94 | | [placement](#input\_placement) | The placement specifications of the instances | object({
affinity = string
availability_zone = string
group_name = string
host_id = string
tenancy = string
}) | `null` | no |
95 | | [placement\_group](#input\_placement\_group) | The name of the placement group into which you'll launch your instances, if any | `string` | `""` | no |
96 | | [protect\_from\_scale\_in](#input\_protect\_from\_scale\_in) | Allows setting instance protection. The autoscaling group will not select instances with this setting for terminination during scale in events | `bool` | `false` | no |
97 | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
98 | | [scale\_down\_adjustment\_type](#input\_scale\_down\_adjustment\_type) | Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity` and `PercentChangeInCapacity` | `string` | `"ChangeInCapacity"` | no |
99 | | [scale\_down\_cooldown\_seconds](#input\_scale\_down\_cooldown\_seconds) | The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start | `number` | `300` | no |
100 | | [scale\_down\_policy\_type](#input\_scale\_down\_policy\_type) | The scaling policy type. Currently only `SimpleScaling` is supported | `string` | `"SimpleScaling"` | no |
101 | | [scale\_down\_scaling\_adjustment](#input\_scale\_down\_scaling\_adjustment) | The number of instances by which to scale. `scale_down_scaling_adjustment` determines the interpretation of this number (e.g. as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity | `number` | `-1` | no |
102 | | [scale\_up\_adjustment\_type](#input\_scale\_up\_adjustment\_type) | Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity` and `PercentChangeInCapacity` | `string` | `"ChangeInCapacity"` | no |
103 | | [scale\_up\_cooldown\_seconds](#input\_scale\_up\_cooldown\_seconds) | The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start | `number` | `300` | no |
104 | | [scale\_up\_policy\_type](#input\_scale\_up\_policy\_type) | The scaling policy type. Currently only `SimpleScaling` is supported | `string` | `"SimpleScaling"` | no |
105 | | [scale\_up\_scaling\_adjustment](#input\_scale\_up\_scaling\_adjustment) | The number of instances by which to scale. `scale_up_adjustment_type` determines the interpretation of this number (e.g. as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity | `number` | `1` | no |
106 | | [security\_group\_ids](#input\_security\_group\_ids) | A list of associated security group IDs | `list(string)` | `[]` | no |
107 | | [service\_linked\_role\_arn](#input\_service\_linked\_role\_arn) | The ARN of the service-linked role that the ASG will use to call other AWS services | `string` | `""` | no |
108 | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
109 | | [subnet\_ids](#input\_subnet\_ids) | A list of subnet IDs to launch resources in | `list(string)` | n/a | yes |
110 | | [suspended\_processes](#input\_suspended\_processes) | 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. | `list(string)` | `[]` | no |
111 | | [tag\_specifications\_resource\_types](#input\_tag\_specifications\_resource\_types) | List of tag specification resource types to tag. Valid values are instance, volume, elastic-gpu and spot-instances-request. | `set(string)` | [
"instance",
"volume"
]
| no |
112 | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
113 | | [target\_group\_arns](#input\_target\_group\_arns) | A list of aws\_alb\_target\_group ARNs, for use with Application Load Balancing | `list(string)` | `[]` | no |
114 | | [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
115 | | [termination\_policies](#input\_termination\_policies) | 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` | `list(string)` | [
"Default"
]
| no |
116 | | [update\_default\_version](#input\_update\_default\_version) | Whether to update Default version of Launch template each update | `bool` | `false` | no |
117 | | [user\_data\_base64](#input\_user\_data\_base64) | The Base64-encoded user data to provide when launching the instances | `string` | `""` | no |
118 | | [wait\_for\_capacity\_timeout](#input\_wait\_for\_capacity\_timeout) | A maximum duration that Terraform should wait for ASG instances to be healthy before timing out. Setting this to '0' causes Terraform to skip all Capacity Waiting behavior | `string` | `"10m"` | no |
119 | | [wait\_for\_elb\_capacity](#input\_wait\_for\_elb\_capacity) | 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 | `number` | `0` | no |
120 | | [warm\_pool](#input\_warm\_pool) | If this block is configured, add a Warm Pool to the specified Auto Scaling group. See [warm\_pool](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#warm_pool). | object({
pool_state = string
min_size = number
max_group_prepared_capacity = number
}) | `null` | no |
121 |
122 | ## Outputs
123 |
124 | | Name | Description |
125 | |------|-------------|
126 | | [autoscaling\_group\_arn](#output\_autoscaling\_group\_arn) | ARN of the AutoScaling Group |
127 | | [autoscaling\_group\_default\_cooldown](#output\_autoscaling\_group\_default\_cooldown) | Time between a scaling activity and the succeeding scaling activity |
128 | | [autoscaling\_group\_desired\_capacity](#output\_autoscaling\_group\_desired\_capacity) | The number of Amazon EC2 instances that should be running in the group |
129 | | [autoscaling\_group\_health\_check\_grace\_period](#output\_autoscaling\_group\_health\_check\_grace\_period) | Time after instance comes into service before checking health |
130 | | [autoscaling\_group\_health\_check\_type](#output\_autoscaling\_group\_health\_check\_type) | `EC2` or `ELB`. Controls how health checking is done |
131 | | [autoscaling\_group\_id](#output\_autoscaling\_group\_id) | The AutoScaling Group id |
132 | | [autoscaling\_group\_max\_size](#output\_autoscaling\_group\_max\_size) | The maximum size of the autoscale group |
133 | | [autoscaling\_group\_min\_size](#output\_autoscaling\_group\_min\_size) | The minimum size of the autoscale group |
134 | | [autoscaling\_group\_name](#output\_autoscaling\_group\_name) | The AutoScaling Group name |
135 | | [autoscaling\_group\_tags](#output\_autoscaling\_group\_tags) | A list of tag settings associated with the AutoScaling Group |
136 | | [autoscaling\_policy\_scale\_down\_arn](#output\_autoscaling\_policy\_scale\_down\_arn) | ARN of the AutoScaling policy scale down |
137 | | [autoscaling\_policy\_scale\_up\_arn](#output\_autoscaling\_policy\_scale\_up\_arn) | ARN of the AutoScaling policy scale up |
138 | | [launch\_template\_arn](#output\_launch\_template\_arn) | The ARN of the launch template |
139 | | [launch\_template\_id](#output\_launch\_template\_id) | The ID of the launch template |
140 |
141 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # terraform-aws-ec2-autoscale-group [](https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/releases/latest) [](https://slack.cloudposse.com)
4 |
5 |
6 | [![README Header][readme_header_img]][readme_header_link]
7 |
8 | [![Cloud Posse][logo]](https://cpco.io/homepage)
9 |
10 |
30 |
31 | Terraform module to provision [Auto Scaling Group](https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html) and [Launch Template](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html) on AWS.
32 |
33 | The module also creates AutoScaling Policies and CloudWatch Metric Alarms to monitor CPU utilization on the EC2 instances and scale the number of instance in the AutoScaling Group up or down.
34 | If you don't want to use the provided functionality, or want to provide your own policies, disable it by setting the variable `autoscaling_policies_enabled` to `false`.
35 |
36 | At present, although you can set the created AutoScaling Policy type to any legal value, in practice [only `SimpleScaling` is supported](https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/issues/55).
37 | To use a `StepScaling` or `TargetTrackingScaling` policy, create it yourself and then pass it in the `alarm_actions` field of `custom_alarms`.
38 |
39 | ---
40 |
41 | This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
42 | [
][share_email]
43 | [
][share_googleplus]
44 | [
][share_facebook]
45 | [
][share_reddit]
46 | [
][share_linkedin]
47 | [
][share_twitter]
48 |
49 |
50 | [][terraform_modules]
51 |
52 |
53 |
54 | It's 100% Open Source and licensed under the [APACHE2](LICENSE).
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | We literally have [*hundreds of terraform modules*][terraform_modules] that are Open Source and well-maintained. Check them out!
63 |
64 |
65 |
66 |
67 |
68 |
69 | ## Security & Compliance [
](https://bridgecrew.io/)
70 |
71 | Security scanning is graciously provided by Bridgecrew. Bridgecrew is the leading fully hosted, cloud-native solution providing continuous Terraform security and compliance.
72 |
73 | | Benchmark | Description |
74 | |--------|---------------|
75 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=INFRASTRUCTURE+SECURITY) | Infrastructure Security Compliance |
76 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=CIS+KUBERNETES+V1.5) | Center for Internet Security, KUBERNETES Compliance |
77 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=CIS+AWS+V1.2) | Center for Internet Security, AWS Compliance |
78 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=CIS+AZURE+V1.1) | Center for Internet Security, AZURE Compliance |
79 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=PCI-DSS+V3.2) | Payment Card Industry Data Security Standards Compliance |
80 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=NIST-800-53) | National Institute of Standards and Technology Compliance |
81 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=ISO27001) | Information Security Management System, ISO/IEC 27001 Compliance |
82 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=SOC2)| Service Organization Control 2 Compliance |
83 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=CIS+GCP+V1.1) | Center for Internet Security, GCP Compliance |
84 | | [](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ec2-autoscale-group&benchmark=HIPAA) | Health Insurance Portability and Accountability Compliance |
85 |
86 |
87 |
88 | ## Usage
89 |
90 |
91 | **IMPORTANT:** We do not pin modules to versions in our examples because of the
92 | difficulty of keeping the versions in the documentation in sync with the latest released versions.
93 | We highly recommend that in your code you pin the version to the exact version you are
94 | using so that your infrastructure remains stable, and update versions in a
95 | systematic way so that they do not catch you by surprise.
96 |
97 | Also, because of a bug in the Terraform registry ([hashicorp/terraform#21417](https://github.com/hashicorp/terraform/issues/21417)),
98 | the registry shows many of our inputs as required when in fact they are optional.
99 | The table below correctly indicates which inputs are required.
100 |
101 |
102 |
103 | ```hcl
104 | locals {
105 | userdata = <<-USERDATA
106 | #!/bin/bash
107 | cat <<"__EOF__" > /home/ec2-user/.ssh/config
108 | Host *
109 | StrictHostKeyChecking no
110 | __EOF__
111 | chmod 600 /home/ec2-user/.ssh/config
112 | chown ec2-user:ec2-user /home/ec2-user/.ssh/config
113 | USERDATA
114 | }
115 |
116 | module "autoscale_group" {
117 | source = "cloudposse/ec2-autoscale-group/aws"
118 | # Cloud Posse recommends pinning every module to a specific version
119 | # version = "x.x.x"
120 |
121 | namespace = var.namespace
122 | stage = var.stage
123 | environment = var.environment
124 | name = var.name
125 |
126 | image_id = "ami-08cab282f9979fc7a"
127 | instance_type = "t2.small"
128 | security_group_ids = ["sg-xxxxxxxx"]
129 | subnet_ids = ["subnet-xxxxxxxx", "subnet-yyyyyyyy", "subnet-zzzzzzzz"]
130 | health_check_type = "EC2"
131 | min_size = 2
132 | max_size = 3
133 | wait_for_capacity_timeout = "5m"
134 | associate_public_ip_address = true
135 | user_data_base64 = base64encode(local.userdata)
136 |
137 | # All inputs to `block_device_mappings` have to be defined
138 | block_device_mappings = [
139 | {
140 | device_name = "/dev/sda1"
141 | no_device = "false"
142 | virtual_name = "root"
143 | ebs = {
144 | encrypted = true
145 | volume_size = 200
146 | delete_on_termination = true
147 | iops = null
148 | kms_key_id = null
149 | snapshot_id = null
150 | volume_type = "standard"
151 | }
152 | }
153 | ]
154 |
155 | tags = {
156 | Tier = "1"
157 | KubernetesCluster = "us-west-2.testing.cloudposse.co"
158 | }
159 |
160 | # Auto-scaling policies and CloudWatch metric alarms
161 | autoscaling_policies_enabled = true
162 | cpu_utilization_high_threshold_percent = "70"
163 | cpu_utilization_low_threshold_percent = "20"
164 | }
165 | ```
166 |
167 | To enable custom_alerts the map needs to be defined like so :
168 | ```hlc
169 | alarms = {
170 | alb_scale_up = {
171 | alarm_name = "${module.default_label.id}-alb-target-response-time-for-scale-up"
172 | comparison_operator = "GreaterThanThreshold"
173 | evaluation_periods = var.alb_target_group_alarms_evaluation_periods
174 | metric_name = "TargetResponseTime"
175 | namespace = "AWS/ApplicationELB"
176 | period = var.alb_target_group_alarms_period
177 | statistic = "Average"
178 | threshold = var.alb_target_group_alarms_response_time_max_threshold
179 | dimensions_name = "LoadBalancer"
180 | dimensions_target = data.alb.arn_suffix
181 | treat_missing_data = "missing"
182 | ok_actions = var.alb_target_group_alarms_ok_actions
183 | insufficient_data_actions = var.alb_target_group_alarms_insufficient_data_actions
184 | alarm_description = "ALB Target response time is over ${var.alb_target_group_alarms_response_time_max_threshold} for more than ${var.alb_target_group_alarms_period}"
185 | alarm_actions = [module.autoscaling.scale_up_policy_arn]
186 | }
187 | }
188 | ```
189 | All those keys are required to be there so if the alarm you are setting does not requiere one or more keys you can just set to empty but do not remove the keys otherwise you could get a weird merge error due to the maps being of different sizes.
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | ## Makefile Targets
198 | ```text
199 | Available targets:
200 |
201 | help Help screen
202 | help/all Display help for all targets
203 | help/short This help short screen
204 | lint Lint terraform code
205 |
206 | ```
207 |
208 |
209 | ## Requirements
210 |
211 | | Name | Version |
212 | |------|---------|
213 | | [terraform](#requirement\_terraform) | >= 0.13 |
214 | | [aws](#requirement\_aws) | >= 2.0 |
215 |
216 | ## Providers
217 |
218 | | Name | Version |
219 | |------|---------|
220 | | [aws](#provider\_aws) | >= 2.0 |
221 |
222 | ## Modules
223 |
224 | | Name | Source | Version |
225 | |------|--------|---------|
226 | | [this](#module\_this) | cloudposse/label/null | 0.25.0 |
227 |
228 | ## Resources
229 |
230 | | Name | Type |
231 | |------|------|
232 | | [aws_autoscaling_group.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group) | resource |
233 | | [aws_autoscaling_policy.scale_down](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_policy) | resource |
234 | | [aws_autoscaling_policy.scale_up](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_policy) | resource |
235 | | [aws_cloudwatch_metric_alarm.all_alarms](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm) | resource |
236 | | [aws_launch_template.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_template) | resource |
237 |
238 | ## Inputs
239 |
240 | | Name | Description | Type | Default | Required |
241 | |------|-------------|------|---------|:--------:|
242 | | [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
This is for some rare cases where resources want additional configuration of tags
and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
243 | | [associate\_public\_ip\_address](#input\_associate\_public\_ip\_address) | Associate a public IP address with an instance in a VPC | `bool` | `false` | no |
244 | | [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no |
245 | | [autoscaling\_policies\_enabled](#input\_autoscaling\_policies\_enabled) | Whether to create `aws_autoscaling_policy` and `aws_cloudwatch_metric_alarm` resources to control Auto Scaling | `bool` | `true` | no |
246 | | [block\_device\_mappings](#input\_block\_device\_mappings) | Specify volumes to attach to the instance besides the volumes specified by the AMI | list(object({
device_name = string
no_device = bool
virtual_name = string
ebs = object({
delete_on_termination = bool
encrypted = bool
iops = number
kms_key_id = string
snapshot_id = string
volume_size = number
volume_type = string
})
})) | `[]` | no |
247 | | [capacity\_rebalance](#input\_capacity\_rebalance) | Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled. | `bool` | `false` | no |
248 | | [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | {
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
} | no |
249 | | [cpu\_utilization\_high\_evaluation\_periods](#input\_cpu\_utilization\_high\_evaluation\_periods) | The number of periods over which data is compared to the specified threshold | `number` | `2` | no |
250 | | [cpu\_utilization\_high\_period\_seconds](#input\_cpu\_utilization\_high\_period\_seconds) | The period in seconds over which the specified statistic is applied | `number` | `300` | no |
251 | | [cpu\_utilization\_high\_statistic](#input\_cpu\_utilization\_high\_statistic) | The statistic to apply to the alarm's associated metric. Either of the following is supported: `SampleCount`, `Average`, `Sum`, `Minimum`, `Maximum` | `string` | `"Average"` | no |
252 | | [cpu\_utilization\_high\_threshold\_percent](#input\_cpu\_utilization\_high\_threshold\_percent) | The value against which the specified statistic is compared | `number` | `90` | no |
253 | | [cpu\_utilization\_low\_evaluation\_periods](#input\_cpu\_utilization\_low\_evaluation\_periods) | The number of periods over which data is compared to the specified threshold | `number` | `2` | no |
254 | | [cpu\_utilization\_low\_period\_seconds](#input\_cpu\_utilization\_low\_period\_seconds) | The period in seconds over which the specified statistic is applied | `number` | `300` | no |
255 | | [cpu\_utilization\_low\_statistic](#input\_cpu\_utilization\_low\_statistic) | The statistic to apply to the alarm's associated metric. Either of the following is supported: `SampleCount`, `Average`, `Sum`, `Minimum`, `Maximum` | `string` | `"Average"` | no |
256 | | [cpu\_utilization\_low\_threshold\_percent](#input\_cpu\_utilization\_low\_threshold\_percent) | The value against which the specified statistic is compared | `number` | `10` | no |
257 | | [credit\_specification](#input\_credit\_specification) | Customize the credit specification of the instances | object({
cpu_credits = string
}) | `null` | no |
258 | | [custom\_alarms](#input\_custom\_alarms) | Map of custom CloudWatch alarms configurations | map(object({
alarm_name = string
comparison_operator = string
evaluation_periods = string
metric_name = string
namespace = string
period = string
statistic = string
threshold = string
treat_missing_data = string
ok_actions = list(string)
insufficient_data_actions = list(string)
dimensions_name = string
dimensions_target = string
alarm_description = string
alarm_actions = list(string)
})) | `{}` | no |
259 | | [default\_alarms\_enabled](#input\_default\_alarms\_enabled) | Enable or disable cpu and memory Cloudwatch alarms | `bool` | `true` | no |
260 | | [default\_cooldown](#input\_default\_cooldown) | The amount of time, in seconds, after a scaling activity completes before another scaling activity can start | `number` | `300` | no |
261 | | [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
262 | | [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
263 | | [desired\_capacity](#input\_desired\_capacity) | The number of Amazon EC2 instances that should be running in the group, if not set will use `min_size` as value | `number` | `null` | no |
264 | | [disable\_api\_termination](#input\_disable\_api\_termination) | If `true`, enables EC2 Instance Termination Protection | `bool` | `false` | no |
265 | | [ebs\_optimized](#input\_ebs\_optimized) | If true, the launched EC2 instance will be EBS-optimized | `bool` | `false` | no |
266 | | [elastic\_gpu\_specifications](#input\_elastic\_gpu\_specifications) | Specifications of Elastic GPU to attach to the instances | object({
type = string
}) | `null` | no |
267 | | [enable\_monitoring](#input\_enable\_monitoring) | Enable/disable detailed monitoring | `bool` | `true` | no |
268 | | [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
269 | | [enabled\_metrics](#input\_enabled\_metrics) | A list of metrics to collect. The allowed values are `GroupMinSize`, `GroupMaxSize`, `GroupDesiredCapacity`, `GroupInServiceInstances`, `GroupPendingInstances`, `GroupStandbyInstances`, `GroupTerminatingInstances`, `GroupTotalInstances` | `list(string)` | [
"GroupMinSize",
"GroupMaxSize",
"GroupDesiredCapacity",
"GroupInServiceInstances",
"GroupPendingInstances",
"GroupStandbyInstances",
"GroupTerminatingInstances",
"GroupTotalInstances"
]
| no |
270 | | [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
271 | | [force\_delete](#input\_force\_delete) | 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 | `bool` | `false` | no |
272 | | [health\_check\_grace\_period](#input\_health\_check\_grace\_period) | Time (in seconds) after instance comes into service before checking health | `number` | `300` | no |
273 | | [health\_check\_type](#input\_health\_check\_type) | Controls how health checking is done. Valid values are `EC2` or `ELB` | `string` | `"EC2"` | no |
274 | | [iam\_instance\_profile\_name](#input\_iam\_instance\_profile\_name) | The IAM instance profile name to associate with launched instances | `string` | `""` | no |
275 | | [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).
Set to `0` for unlimited length.
Set to `null` for keep the existing setting, which defaults to `0`.
Does not affect `id_full`. | `number` | `null` | no |
276 | | [image\_id](#input\_image\_id) | The EC2 image ID to launch | `string` | `""` | no |
277 | | [instance\_initiated\_shutdown\_behavior](#input\_instance\_initiated\_shutdown\_behavior) | Shutdown behavior for the instances. Can be `stop` or `terminate` | `string` | `"terminate"` | no |
278 | | [instance\_market\_options](#input\_instance\_market\_options) | The market (purchasing) option for the instances | object({
market_type = string
spot_options = object({
block_duration_minutes = number
instance_interruption_behavior = string
max_price = number
spot_instance_type = string
valid_until = string
})
}) | `null` | no |
279 | | [instance\_refresh](#input\_instance\_refresh) | The instance refresh definition | object({
strategy = string
preferences = object({
instance_warmup = number
min_healthy_percentage = number
})
triggers = list(string)
}) | `null` | no |
280 | | [instance\_type](#input\_instance\_type) | Instance type to launch | `string` | n/a | yes |
281 | | [key\_name](#input\_key\_name) | The SSH key name that should be used for the instance | `string` | `""` | no |
282 | | [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.
Does not affect keys of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper`.
Default value: `title`. | `string` | `null` | no |
283 | | [label\_order](#input\_label\_order) | The order in which the labels (ID elements) appear in the `id`.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. | `list(string)` | `null` | no |
284 | | [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,
set as tag values, and output by this module individually.
Does not affect values of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.
Default value: `lower`. | `string` | `null` | no |
285 | | [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.
Default is to include all labels.
Tags with empty values will not be included in the `tags` output.
Set to `[]` to suppress all generated tags.
**Notes:**
The value of the `name` tag, if included, will be the `id`, not the `name`.
Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be
changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` | [
"default"
]
| no |
286 | | [launch\_template\_version](#input\_launch\_template\_version) | Launch template version. Can be version number, `$Latest` or `$Default` | `string` | `"$Latest"` | no |
287 | | [load\_balancers](#input\_load\_balancers) | A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use `target_group_arns` instead | `list(string)` | `[]` | no |
288 | | [max\_instance\_lifetime](#input\_max\_instance\_lifetime) | 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 | `number` | `null` | no |
289 | | [max\_size](#input\_max\_size) | The maximum size of the autoscale group | `number` | n/a | yes |
290 | | [metadata\_http\_endpoint\_enabled](#input\_metadata\_http\_endpoint\_enabled) | Set false to disable the Instance Metadata Service. | `bool` | `true` | no |
291 | | [metadata\_http\_protocol\_ipv6\_enabled](#input\_metadata\_http\_protocol\_ipv6\_enabled) | Set true to enable IPv6 in the launch template. | `bool` | `false` | no |
292 | | [metadata\_http\_put\_response\_hop\_limit](#input\_metadata\_http\_put\_response\_hop\_limit) | The desired HTTP PUT response hop limit (between 1 and 64) for Instance Metadata Service requests.
The default is `2` to support containerized workloads. | `number` | `2` | no |
293 | | [metadata\_http\_tokens\_required](#input\_metadata\_http\_tokens\_required) | Set true to require IMDS session tokens, disabling Instance Metadata Service Version 1. | `bool` | `true` | no |
294 | | [metadata\_instance\_metadata\_tags\_enabled](#input\_metadata\_instance\_metadata\_tags\_enabled) | Set true to enable metadata tags in the launch template. | `bool` | `false` | no |
295 | | [metrics\_granularity](#input\_metrics\_granularity) | The granularity to associate with the metrics to collect. The only valid value is 1Minute | `string` | `"1Minute"` | no |
296 | | [min\_elb\_capacity](#input\_min\_elb\_capacity) | 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 | `number` | `0` | no |
297 | | [min\_size](#input\_min\_size) | The minimum size of the autoscale group | `number` | n/a | yes |
298 | | [mixed\_instances\_policy](#input\_mixed\_instances\_policy) | policy to used mixed group of on demand/spot of differing types. Launch template is automatically generated. https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#mixed_instances_policy-1 | object({
instances_distribution = object({
on_demand_allocation_strategy = string
on_demand_base_capacity = number
on_demand_percentage_above_base_capacity = number
spot_allocation_strategy = string
spot_instance_pools = number
spot_max_price = string
})
override = list(object({
instance_type = string
weighted_capacity = number
}))
}) | `null` | no |
299 | | [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
This is the only ID element not also included as a `tag`.
The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
300 | | [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
301 | | [placement](#input\_placement) | The placement specifications of the instances | object({
affinity = string
availability_zone = string
group_name = string
host_id = string
tenancy = string
}) | `null` | no |
302 | | [placement\_group](#input\_placement\_group) | The name of the placement group into which you'll launch your instances, if any | `string` | `""` | no |
303 | | [protect\_from\_scale\_in](#input\_protect\_from\_scale\_in) | Allows setting instance protection. The autoscaling group will not select instances with this setting for terminination during scale in events | `bool` | `false` | no |
304 | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
305 | | [scale\_down\_adjustment\_type](#input\_scale\_down\_adjustment\_type) | Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity` and `PercentChangeInCapacity` | `string` | `"ChangeInCapacity"` | no |
306 | | [scale\_down\_cooldown\_seconds](#input\_scale\_down\_cooldown\_seconds) | The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start | `number` | `300` | no |
307 | | [scale\_down\_policy\_type](#input\_scale\_down\_policy\_type) | The scaling policy type. Currently only `SimpleScaling` is supported | `string` | `"SimpleScaling"` | no |
308 | | [scale\_down\_scaling\_adjustment](#input\_scale\_down\_scaling\_adjustment) | The number of instances by which to scale. `scale_down_scaling_adjustment` determines the interpretation of this number (e.g. as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity | `number` | `-1` | no |
309 | | [scale\_up\_adjustment\_type](#input\_scale\_up\_adjustment\_type) | Specifies whether the adjustment is an absolute number or a percentage of the current capacity. Valid values are `ChangeInCapacity`, `ExactCapacity` and `PercentChangeInCapacity` | `string` | `"ChangeInCapacity"` | no |
310 | | [scale\_up\_cooldown\_seconds](#input\_scale\_up\_cooldown\_seconds) | The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start | `number` | `300` | no |
311 | | [scale\_up\_policy\_type](#input\_scale\_up\_policy\_type) | The scaling policy type. Currently only `SimpleScaling` is supported | `string` | `"SimpleScaling"` | no |
312 | | [scale\_up\_scaling\_adjustment](#input\_scale\_up\_scaling\_adjustment) | The number of instances by which to scale. `scale_up_adjustment_type` determines the interpretation of this number (e.g. as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity | `number` | `1` | no |
313 | | [security\_group\_ids](#input\_security\_group\_ids) | A list of associated security group IDs | `list(string)` | `[]` | no |
314 | | [service\_linked\_role\_arn](#input\_service\_linked\_role\_arn) | The ARN of the service-linked role that the ASG will use to call other AWS services | `string` | `""` | no |
315 | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
316 | | [subnet\_ids](#input\_subnet\_ids) | A list of subnet IDs to launch resources in | `list(string)` | n/a | yes |
317 | | [suspended\_processes](#input\_suspended\_processes) | 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. | `list(string)` | `[]` | no |
318 | | [tag\_specifications\_resource\_types](#input\_tag\_specifications\_resource\_types) | List of tag specification resource types to tag. Valid values are instance, volume, elastic-gpu and spot-instances-request. | `set(string)` | [
"instance",
"volume"
]
| no |
319 | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
320 | | [target\_group\_arns](#input\_target\_group\_arns) | A list of aws\_alb\_target\_group ARNs, for use with Application Load Balancing | `list(string)` | `[]` | no |
321 | | [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
322 | | [termination\_policies](#input\_termination\_policies) | 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` | `list(string)` | [
"Default"
]
| no |
323 | | [update\_default\_version](#input\_update\_default\_version) | Whether to update Default version of Launch template each update | `bool` | `false` | no |
324 | | [user\_data\_base64](#input\_user\_data\_base64) | The Base64-encoded user data to provide when launching the instances | `string` | `""` | no |
325 | | [wait\_for\_capacity\_timeout](#input\_wait\_for\_capacity\_timeout) | A maximum duration that Terraform should wait for ASG instances to be healthy before timing out. Setting this to '0' causes Terraform to skip all Capacity Waiting behavior | `string` | `"10m"` | no |
326 | | [wait\_for\_elb\_capacity](#input\_wait\_for\_elb\_capacity) | 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 | `number` | `0` | no |
327 | | [warm\_pool](#input\_warm\_pool) | If this block is configured, add a Warm Pool to the specified Auto Scaling group. See [warm\_pool](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#warm_pool). | object({
pool_state = string
min_size = number
max_group_prepared_capacity = number
}) | `null` | no |
328 |
329 | ## Outputs
330 |
331 | | Name | Description |
332 | |------|-------------|
333 | | [autoscaling\_group\_arn](#output\_autoscaling\_group\_arn) | ARN of the AutoScaling Group |
334 | | [autoscaling\_group\_default\_cooldown](#output\_autoscaling\_group\_default\_cooldown) | Time between a scaling activity and the succeeding scaling activity |
335 | | [autoscaling\_group\_desired\_capacity](#output\_autoscaling\_group\_desired\_capacity) | The number of Amazon EC2 instances that should be running in the group |
336 | | [autoscaling\_group\_health\_check\_grace\_period](#output\_autoscaling\_group\_health\_check\_grace\_period) | Time after instance comes into service before checking health |
337 | | [autoscaling\_group\_health\_check\_type](#output\_autoscaling\_group\_health\_check\_type) | `EC2` or `ELB`. Controls how health checking is done |
338 | | [autoscaling\_group\_id](#output\_autoscaling\_group\_id) | The AutoScaling Group id |
339 | | [autoscaling\_group\_max\_size](#output\_autoscaling\_group\_max\_size) | The maximum size of the autoscale group |
340 | | [autoscaling\_group\_min\_size](#output\_autoscaling\_group\_min\_size) | The minimum size of the autoscale group |
341 | | [autoscaling\_group\_name](#output\_autoscaling\_group\_name) | The AutoScaling Group name |
342 | | [autoscaling\_group\_tags](#output\_autoscaling\_group\_tags) | A list of tag settings associated with the AutoScaling Group |
343 | | [autoscaling\_policy\_scale\_down\_arn](#output\_autoscaling\_policy\_scale\_down\_arn) | ARN of the AutoScaling policy scale down |
344 | | [autoscaling\_policy\_scale\_up\_arn](#output\_autoscaling\_policy\_scale\_up\_arn) | ARN of the AutoScaling policy scale up |
345 | | [launch\_template\_arn](#output\_launch\_template\_arn) | The ARN of the launch template |
346 | | [launch\_template\_id](#output\_launch\_template\_id) | The ID of the launch template |
347 |
348 |
349 |
350 |
351 | ## Share the Love
352 |
353 | Like this project? Please give it a ★ on [our GitHub](https://github.com/cloudposse/terraform-aws-ec2-autoscale-group)! (it helps us **a lot**)
354 |
355 | Are you using this project or any of our other projects? Consider [leaving a testimonial][testimonial]. =)
356 |
357 |
358 |
359 | ## Related Projects
360 |
361 | Check out these related projects.
362 |
363 | - [terraform-aws-ec2-instance](https://github.com/cloudposse/terraform-aws-ec2-instance) - Terraform module for providing a general purpose EC2 instance
364 | - [terraform-aws-ec2-bastion-server](https://github.com/cloudposse/terraform-aws-ec2-bastion-server) - Terraform module to define a generic bastion host with parameterized user data
365 | - [terraform-aws-ec2-admin-server](https://github.com/cloudposse/terraform-aws-ec2-admin-server) - Terraform module for providing an EC2 instance capable of running admin tasks
366 | - [terraform-aws-ec2-instance-group](https://github.com/cloudposse/terraform-aws-ec2-instance-group) - Terraform module for provisioning multiple general purpose EC2 hosts for stateful applications
367 | - [terraform-aws-ec2-ami-snapshot](https://github.com/cloudposse/terraform-aws-ec2-ami-snapshot) - Terraform module to easily generate AMI snapshots to create replica instances
368 |
369 | ## Help
370 |
371 | **Got a question?** We got answers.
372 |
373 | File a GitHub [issue](https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/issues), send us an [email][email] or join our [Slack Community][slack].
374 |
375 | [![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link]
376 |
377 | ## DevOps Accelerator for Startups
378 |
379 |
380 | We are a [**DevOps Accelerator**][commercial_support]. We'll help you build your cloud infrastructure from the ground up so you can own it. Then we'll show you how to operate it and stick around for as long as you need us.
381 |
382 | [][commercial_support]
383 |
384 | Work directly with our team of DevOps experts via email, slack, and video conferencing.
385 |
386 | We deliver 10x the value for a fraction of the cost of a full-time engineer. Our track record is not even funny. If you want things done right and you need it done FAST, then we're your best bet.
387 |
388 | - **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code.
389 | - **Release Engineering.** You'll have end-to-end CI/CD with unlimited staging environments.
390 | - **Site Reliability Engineering.** You'll have total visibility into your apps and microservices.
391 | - **Security Baseline.** You'll have built-in governance with accountability and audit logs for all changes.
392 | - **GitOps.** You'll be able to operate your infrastructure via Pull Requests.
393 | - **Training.** You'll receive hands-on training so your team can operate what we build.
394 | - **Questions.** You'll have a direct line of communication between our teams via a Shared Slack channel.
395 | - **Troubleshooting.** You'll get help to triage when things aren't working.
396 | - **Code Reviews.** You'll receive constructive feedback on Pull Requests.
397 | - **Bug Fixes.** We'll rapidly work with you to fix any bugs in our projects.
398 |
399 | ## Slack Community
400 |
401 | Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
402 |
403 | ## Discourse Forums
404 |
405 | Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account.
406 |
407 | ## Newsletter
408 |
409 | Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
410 |
411 | ## Office Hours
412 |
413 | [Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone!
414 |
415 | [][office_hours]
416 |
417 | ## Contributing
418 |
419 | ### Bug Reports & Feature Requests
420 |
421 | Please use the [issue tracker](https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/issues) to report any bugs or file feature requests.
422 |
423 | ### Developing
424 |
425 | If you are interested in being a contributor and want to get involved in developing this project or [help out](https://cpco.io/help-out) with our other projects, we would love to hear from you! Shoot us an [email][email].
426 |
427 | In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
428 |
429 | 1. **Fork** the repo on GitHub
430 | 2. **Clone** the project to your own machine
431 | 3. **Commit** changes to your own branch
432 | 4. **Push** your work back up to your fork
433 | 5. Submit a **Pull Request** so that we can review your changes
434 |
435 | **NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
436 |
437 |
438 | ## Copyright
439 |
440 | Copyright © 2017-2022 [Cloud Posse, LLC](https://cpco.io/copyright)
441 |
442 |
443 |
444 | ## License
445 |
446 | [](https://opensource.org/licenses/Apache-2.0)
447 |
448 | See [LICENSE](LICENSE) for full details.
449 |
450 | ```text
451 | Licensed to the Apache Software Foundation (ASF) under one
452 | or more contributor license agreements. See the NOTICE file
453 | distributed with this work for additional information
454 | regarding copyright ownership. The ASF licenses this file
455 | to you under the Apache License, Version 2.0 (the
456 | "License"); you may not use this file except in compliance
457 | with the License. You may obtain a copy of the License at
458 |
459 | https://www.apache.org/licenses/LICENSE-2.0
460 |
461 | Unless required by applicable law or agreed to in writing,
462 | software distributed under the License is distributed on an
463 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
464 | KIND, either express or implied. See the License for the
465 | specific language governing permissions and limitations
466 | under the License.
467 | ```
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 | ## Trademarks
478 |
479 | All other trademarks referenced herein are the property of their respective owners.
480 |
481 | ## About
482 |
483 | This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know by [leaving a testimonial][testimonial]!
484 |
485 | [![Cloud Posse][logo]][website]
486 |
487 | We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We ❤️ [Open Source Software][we_love_open_source].
488 |
489 | We offer [paid support][commercial_support] on all of our projects.
490 |
491 | Check out [our other projects][github], [follow us on twitter][twitter], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation.
492 |
493 |
494 |
495 | ### Contributors
496 |
497 |
498 | | [![Erik Osterman][osterman_avatar]][osterman_homepage]
[Erik Osterman][osterman_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]
[Andriy Knysh][aknysh_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]
[Igor Rodionov][goruha_homepage] | [![RB][nitrocode_avatar]][nitrocode_homepage]
[RB][nitrocode_homepage] |
499 | |---|---|---|---|
500 |
501 |
502 | [osterman_homepage]: https://github.com/osterman
503 | [osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png
504 | [aknysh_homepage]: https://github.com/aknysh
505 | [aknysh_avatar]: https://img.cloudposse.com/150x150/https://github.com/aknysh.png
506 | [goruha_homepage]: https://github.com/goruha
507 | [goruha_avatar]: https://img.cloudposse.com/150x150/https://github.com/goruha.png
508 | [nitrocode_homepage]: https://github.com/nitrocode
509 | [nitrocode_avatar]: https://img.cloudposse.com/150x150/https://github.com/nitrocode.png
510 |
511 | [![README Footer][readme_footer_img]][readme_footer_link]
512 | [![Beacon][beacon]][website]
513 |
514 | [logo]: https://cloudposse.com/logo-300x69.svg
515 | [docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=docs
516 | [website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=website
517 | [github]: https://cpco.io/github?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=github
518 | [jobs]: https://cpco.io/jobs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=jobs
519 | [hire]: https://cpco.io/hire?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=hire
520 | [slack]: https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=slack
521 | [linkedin]: https://cpco.io/linkedin?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=linkedin
522 | [twitter]: https://cpco.io/twitter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=twitter
523 | [testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=testimonial
524 | [office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=office_hours
525 | [newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=newsletter
526 | [discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=discourse
527 | [email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=email
528 | [commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=commercial_support
529 | [we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=we_love_open_source
530 | [terraform_modules]: https://cpco.io/terraform-modules?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=terraform_modules
531 | [readme_header_img]: https://cloudposse.com/readme/header/img
532 | [readme_header_link]: https://cloudposse.com/readme/header/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=readme_header_link
533 | [readme_footer_img]: https://cloudposse.com/readme/footer/img
534 | [readme_footer_link]: https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=readme_footer_link
535 | [readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img
536 | [readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-autoscale-group&utm_content=readme_commercial_support_link
537 | [share_twitter]: https://twitter.com/intent/tweet/?text=terraform-aws-ec2-autoscale-group&url=https://github.com/cloudposse/terraform-aws-ec2-autoscale-group
538 | [share_linkedin]: https://www.linkedin.com/shareArticle?mini=true&title=terraform-aws-ec2-autoscale-group&url=https://github.com/cloudposse/terraform-aws-ec2-autoscale-group
539 | [share_reddit]: https://reddit.com/submit/?url=https://github.com/cloudposse/terraform-aws-ec2-autoscale-group
540 | [share_facebook]: https://facebook.com/sharer/sharer.php?u=https://github.com/cloudposse/terraform-aws-ec2-autoscale-group
541 | [share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/terraform-aws-ec2-autoscale-group
542 | [share_email]: mailto:?subject=terraform-aws-ec2-autoscale-group&body=https://github.com/cloudposse/terraform-aws-ec2-autoscale-group
543 | [beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-aws-ec2-autoscale-group?pixel&cs=github&cm=readme&an=terraform-aws-ec2-autoscale-group
544 |
--------------------------------------------------------------------------------