Skip to content

Commit 8b15fc0

Browse files
committed
Add rollout options to Helm module
1 parent 864f91a commit 8b15fc0

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The module has been tested with:
3232
| <a name="module_database"></a> [database](#module\_database) | ./modules/database | n/a |
3333
| <a name="module_eks"></a> [eks](#module\_eks) | ./modules/eks | n/a |
3434
| <a name="module_networking"></a> [networking](#module\_networking) | ./modules/networking | n/a |
35-
| <a name="module_operator"></a> [operator](#module\_operator) | github.com/MaterializeInc/terraform-helm-materialize | v0.1.3 |
35+
| <a name="module_operator"></a> [operator](#module\_operator) | github.com/MaterializeInc/terraform-helm-materialize | v0.1.4 |
3636
| <a name="module_storage"></a> [storage](#module\_storage) | ./modules/storage | n/a |
3737

3838
## Resources
@@ -76,7 +76,7 @@ The module has been tested with:
7676
| <a name="input_install_metrics_server"></a> [install\_metrics\_server](#input\_install\_metrics\_server) | Whether to install the metrics-server for the Materialize Console | `bool` | `true` | no |
7777
| <a name="input_kubernetes_namespace"></a> [kubernetes\_namespace](#input\_kubernetes\_namespace) | The Kubernetes namespace for the Materialize resources | `string` | `"materialize-environment"` | no |
7878
| <a name="input_log_group_name_prefix"></a> [log\_group\_name\_prefix](#input\_log\_group\_name\_prefix) | Prefix for the CloudWatch log group name (will be combined with environment name) | `string` | `"materialize"` | no |
79-
| <a name="input_materialize_instances"></a> [materialize\_instances](#input\_materialize\_instances) | Configuration for Materialize instances | <pre>list(object({<br/> name = string<br/> namespace = optional(string)<br/> database_name = string<br/> environmentd_version = optional(string, "v0.130.1")<br/> cpu_request = optional(string, "1")<br/> memory_request = optional(string, "1Gi")<br/> memory_limit = optional(string, "1Gi")<br/> create_database = optional(bool, true)<br/> }))</pre> | `[]` | no |
79+
| <a name="input_materialize_instances"></a> [materialize\_instances](#input\_materialize\_instances) | Configuration for Materialize instances | <pre>list(object({<br/> name = string<br/> namespace = optional(string)<br/> database_name = string<br/> environmentd_version = optional(string, "v0.130.1")<br/> cpu_request = optional(string, "1")<br/> memory_request = optional(string, "1Gi")<br/> memory_limit = optional(string, "1Gi")<br/> create_database = optional(bool, true)<br/> in_place_rollout = optional(bool, false)<br/> request_rollout = optional(string)<br/> force_rollout = optional(string)<br/> }))</pre> | `[]` | no |
8080
| <a name="input_metrics_retention_days"></a> [metrics\_retention\_days](#input\_metrics\_retention\_days) | Number of days to retain CloudWatch metrics | `number` | `7` | no |
8181
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace for all resources, usually the organization or project name | `string` | n/a | yes |
8282
| <a name="input_network_id"></a> [network\_id](#input\_network\_id) | The ID of the VPC in which resources will be deployed. Only used if create\_vpc is false. | `string` | `""` | no |

main.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module "database" {
7979
}
8080

8181
module "operator" {
82-
source = "github.com/MaterializeInc/terraform-helm-materialize?ref=v0.1.3"
82+
source = "github.com/MaterializeInc/terraform-helm-materialize?ref=v0.1.4"
8383

8484
count = var.install_materialize_operator ? 1 : 0
8585

@@ -166,6 +166,11 @@ locals {
166166
cpu_request = instance.cpu_request
167167
memory_request = instance.memory_request
168168
memory_limit = instance.memory_limit
169+
170+
# Rollout options
171+
in_place_rollout = instance.in_place_rollout
172+
request_rollout = instance.request_rollout
173+
force_rollout = instance.force_rollout
169174
}
170175
]
171176

variables.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,29 @@ variable "materialize_instances" {
301301
memory_request = optional(string, "1Gi")
302302
memory_limit = optional(string, "1Gi")
303303
create_database = optional(bool, true)
304+
in_place_rollout = optional(bool, false)
305+
request_rollout = optional(string)
306+
force_rollout = optional(string)
304307
}))
305308
default = []
309+
310+
validation {
311+
condition = alltrue([
312+
for instance in var.materialize_instances :
313+
instance.request_rollout == null ||
314+
can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", instance.request_rollout))
315+
])
316+
error_message = "Request rollout must be a valid UUID in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
317+
}
318+
319+
validation {
320+
condition = alltrue([
321+
for instance in var.materialize_instances :
322+
instance.force_rollout == null ||
323+
can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", instance.force_rollout))
324+
])
325+
error_message = "Force rollout must be a valid UUID in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
326+
}
306327
}
307328

308329
variable "install_metrics_server" {

0 commit comments

Comments
 (0)