Skip to content

Commit 056bac7

Browse files
artiombarbArtem Barbaruk
andauthored
feat: add additional mwaa environment options to adjust number of running web servers and schedulers (#70)
Co-authored-by: Artem Barbaruk <tyomadj@gmail.com>
1 parent 90e1aef commit 056bac7

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ Here is an example of using this module:
166166
| <a name="input_labels_as_tags"></a> [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.<br/>Default is to include all labels.<br/>Tags with empty values will not be included in the `tags` output.<br/>Set to `[]` to suppress all generated tags.<br/>**Notes:**<br/> The value of the `name` tag, if included, will be the `id`, not the `name`.<br/> Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be<br/> changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` | <pre>[<br/> "default"<br/>]</pre> | no |
167167
| <a name="input_max_workers"></a> [max\_workers](#input\_max\_workers) | The maximum number of workers that can be automatically scaled up. Value need to be between 1 and 25. | `number` | `10` | no |
168168
| <a name="input_min_workers"></a> [min\_workers](#input\_min\_workers) | The minimum number of workers that you want to run in your environment. | `number` | `1` | no |
169+
| <a name="input_max_webservers"></a> [max\_webservers](#input\_max\_webservers) | The maximum number of web servers that you want to run in your environment. Value need to be between 2 and 5 if environment_class is not `mw1.micro`, 1 otherwise. | `number` | `2` | no |
170+
| <a name="input_min_webservers"></a> [min\_webservers](#input\_min\_webservers) | The minimum number of web servers that you want to run in your environment. Value need to be between 2 and 5 if environment_class is not `mw1.micro`, 1 otherwise. | `number` | `2` | no |
171+
| <a name="input_schedulers"></a> [schedulers](#input\_schedulers) | The number of schedulers that you want to run in your environment. v2.0.2 and above accepts 2 - 5 | `number` | `2` | no |
169172
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br/>This is the only ID element not also included as a `tag`.<br/>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
170173
| <a name="input_namespace"></a> [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 |
171174
| <a name="input_plugins_s3_object_version"></a> [plugins\_s3\_object\_version](#input\_plugins\_s3\_object\_version) | The plugins.zip file version you want to use. | `string` | `null` | no |

main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ resource "aws_mwaa_environment" "default" {
223223
kms_key = var.kms_key
224224
max_workers = var.max_workers
225225
min_workers = var.min_workers
226+
min_webservers = var.environment_class == "mw1.micro" ? 1 : var.min_webservers
227+
max_webservers = var.environment_class == "mw1.micro" ? 1 : var.max_webservers
228+
schedulers = var.schedulers
226229
plugins_s3_object_version = var.plugins_s3_object_version
227230
plugins_s3_path = var.plugins_s3_path
228231
requirements_s3_object_version = var.requirements_s3_object_version

variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@ variable "min_workers" {
8181
default = 1
8282
}
8383

84+
variable "max_webservers" {
85+
type = number
86+
description = "The maximum number of web servers that you want to run in your environment."
87+
default = 2
88+
}
89+
90+
variable "min_webservers" {
91+
type = number
92+
description = "The minimum number of web servers that you want to run in your environment."
93+
default = 2
94+
}
95+
96+
variable "schedulers" {
97+
type = number
98+
description = "The number of schedulers that you want to run in your environment."
99+
default = 2
100+
}
101+
84102
variable "plugins_s3_object_version" {
85103
type = string
86104
description = "The plugins.zip file version you want to use."

0 commit comments

Comments
 (0)