Skip to content

Commit aa880a3

Browse files
authored
Add var for optinal database creation (#23)
* Add var for optinal database creation * Reduce CPU request in the simple example
1 parent 20aa8c1 commit aa880a3

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
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.2 |
35+
| <a name="module_operator"></a> [operator](#module\_operator) | github.com/MaterializeInc/terraform-helm-materialize | v0.1.3 |
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/> }))</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/> }))</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 |

examples/simple/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ Once the infrastructure and the Materialize Operator are installed, you can depl
6565
name = "demo"
6666
namespace = "materialize-environment"
6767
database_name = "demo_db"
68-
cpu_request = "4"
69-
memory_request = "8Gi"
70-
memory_limit = "8Gi"
68+
cpu_request = "2"
69+
memory_request = "4Gi"
70+
memory_limit = "4Gi"
7171
}
7272
]
7373
```

examples/simple/main.tf

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,13 @@ variable "database_password" {
8282
variable "materialize_instances" {
8383
description = "List of Materialize instances to be created."
8484
type = list(object({
85-
name = string
86-
namespace = string
87-
database_name = string
88-
cpu_request = string
89-
memory_request = string
90-
memory_limit = string
85+
name = string
86+
namespace = string
87+
database_name = string
88+
cpu_request = string
89+
memory_request = string
90+
memory_limit = string
91+
create_database = optional(bool)
9192
}))
9293
default = []
9394
}

main.tf

Lines changed: 5 additions & 4 deletions
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.2"
82+
source = "github.com/MaterializeInc/terraform-helm-materialize?ref=v0.1.3"
8383

8484
count = var.install_materialize_operator ? 1 : 0
8585

@@ -141,9 +141,10 @@ locals {
141141

142142
instances = [
143143
for instance in var.materialize_instances : {
144-
name = instance.name
145-
namespace = instance.namespace
146-
database_name = instance.database_name
144+
name = instance.name
145+
namespace = instance.namespace
146+
database_name = instance.database_name
147+
create_database = instance.create_database
147148

148149
metadata_backend_url = format(
149150
"postgres://%s:%s@%s/%s?sslmode=require",

variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ variable "materialize_instances" {
300300
cpu_request = optional(string, "1")
301301
memory_request = optional(string, "1Gi")
302302
memory_limit = optional(string, "1Gi")
303+
create_database = optional(bool, true)
303304
}))
304305
default = []
305306
}

0 commit comments

Comments
 (0)