Skip to content

Commit 12e931d

Browse files
NLB docs
1 parent 4f9e377 commit 12e931d

File tree

7 files changed

+87
-4
lines changed

7 files changed

+87
-4
lines changed

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Terraform module for deploying Materialize on AWS Cloud Platform with all requir
77
88
The module has been tested with:
99
- PostgreSQL 15
10-
- Materialize Helm Operator Terraform Module v0.1.1
10+
- Materialize Helm Operator Terraform Module v0.1.8
1111

1212
## Providers Configuration
1313

@@ -125,7 +125,7 @@ export AWS_PROFILE=your-profile-name
125125
| <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 |
126126
| <a name="input_kubernetes_namespace"></a> [kubernetes\_namespace](#input\_kubernetes\_namespace) | The Kubernetes namespace for the Materialize resources | `string` | `"materialize-environment"` | no |
127127
| <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 |
128-
| <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.4")<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/> create_nlb = optional(bool, true)<br/> internal_nlb = optional(bool, true)<br/> in_place_rollout = optional(bool, false)<br/> request_rollout = optional(string)<br/> force_rollout = optional(string)<br/> balancer_memory_request = optional(string, "256Mi")<br/> balancer_memory_limit = optional(string, "256Mi")<br/> balancer_cpu_request = optional(string, "100m")<br/> }))</pre> | `[]` | no |
128+
| <a name="input_materialize_instances"></a> [materialize\_instances](#input\_materialize\_instances) | Configuration for Materialize instances. Due to limitations in Terraform, `materialize_instances` cannot be defined on the first `terraform apply`. | <pre>list(object({<br/> name = string<br/> namespace = optional(string)<br/> database_name = string<br/> environmentd_version = optional(string, "v0.130.4")<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/> create_nlb = optional(bool, true)<br/> internal_nlb = optional(bool, true)<br/> enable_cross_zone_load_balancing = optional(bool, true)<br/> in_place_rollout = optional(bool, false)<br/> request_rollout = optional(string)<br/> force_rollout = optional(string)<br/> balancer_memory_request = optional(string, "256Mi")<br/> balancer_memory_limit = optional(string, "256Mi")<br/> balancer_cpu_request = optional(string, "100m")<br/> }))</pre> | `[]` | no |
129129
| <a name="input_metrics_retention_days"></a> [metrics\_retention\_days](#input\_metrics\_retention\_days) | Number of days to retain CloudWatch metrics | `number` | `7` | no |
130130
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace for all resources, usually the organization or project name | `string` | n/a | yes |
131131
| <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 |
@@ -160,6 +160,7 @@ export AWS_PROFILE=your-profile-name
160160
| <a name="output_eks_cluster_name"></a> [eks\_cluster\_name](#output\_eks\_cluster\_name) | EKS cluster name |
161161
| <a name="output_materialize_s3_role_arn"></a> [materialize\_s3\_role\_arn](#output\_materialize\_s3\_role\_arn) | The ARN of the IAM role for Materialize |
162162
| <a name="output_metadata_backend_url"></a> [metadata\_backend\_url](#output\_metadata\_backend\_url) | PostgreSQL connection URL in the format required by Materialize |
163+
| <a name="output_nlb_details"></a> [nlb\_details](#output\_nlb\_details) | Details of the Materialize instance NLBs. |
163164
| <a name="output_oidc_provider_arn"></a> [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider |
164165
| <a name="output_operator_details"></a> [operator\_details](#output\_operator\_details) | Details of the installed Materialize operator |
165166
| <a name="output_persist_backend_url"></a> [persist\_backend\_url](#output\_persist\_backend\_url) | S3 connection URL in the format required by Materialize using IRSA |
@@ -177,4 +178,33 @@ After successfully deploying the infrastructure with this module, you'll need to
177178
1. Deploy your first Materialize environment
178179

179180
See our [Operator Installation Guide](docs/operator-setup.md) for instructions.
181+
182+
## Connecting to Materialize instances
183+
184+
By default, Network Load Balancers are created for each Materialize instance, with three listeners:
185+
1. Port 6875 for SQL connections to the database.
186+
1. Port 6876 for HTTP(S) connections to the database.
187+
1. Port 8080 for HTTP(S) connections to the web console.
188+
189+
The DNS name and ARN for the NLBs will be in the `terraform output` as `nlb_details`.
190+
191+
## Upgrade Notes
192+
193+
#### v0.3.0
194+
We now install the AWS Load Balancer Controller and create Network Load Balancers for each Materialize instance.
195+
196+
If managing Materialize instances with this module, additional action may be required to upgrade to this version.
197+
198+
###### If you want to disable NLB support
199+
* Set `install_aws_load_balancer_controller` to `false`.
200+
* Set `materialize_instances[*].create_nlb` to `false`.
201+
202+
###### If you want to enable NLB support
203+
* Leave `install_aws_load_balancer_controller` set to its default of `true`.
204+
* Set `materialize_instances[*].create_nlb` to `false`.
205+
* Run `terraform apply`.
206+
* Set `materialize_instances[*].create_nlb` to `true`.
207+
* Run `terraform apply`.
208+
209+
Due to limitations in Terraform, it cannot plan Kubernetes resources using CRDs that do not exist yet. We need to first install the AWS Load Balancer Controller in the first `terraform apply`, before defining any `TargetGroupBinding` resources which get created in the second `terraform apply`.
180210
<!-- END_TF_DOCS -->

docs/footer.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,32 @@ After successfully deploying the infrastructure with this module, you'll need to
77
1. Deploy your first Materialize environment
88

99
See our [Operator Installation Guide](docs/operator-setup.md) for instructions.
10+
11+
## Connecting to Materialize instances
12+
13+
By default, Network Load Balancers are created for each Materialize instance, with three listeners:
14+
1. Port 6875 for SQL connections to the database.
15+
1. Port 6876 for HTTP(S) connections to the database.
16+
1. Port 8080 for HTTP(S) connections to the web console.
17+
18+
The DNS name and ARN for the NLBs will be in the `terraform output` as `nlb_details`.
19+
20+
## Upgrade Notes
21+
22+
#### v0.3.0
23+
We now install the AWS Load Balancer Controller and create Network Load Balancers for each Materialize instance.
24+
25+
If managing Materialize instances with this module, additional action may be required to upgrade to this version.
26+
27+
###### If you want to disable NLB support
28+
* Set `install_aws_load_balancer_controller` to `false`.
29+
* Set `materialize_instances[*].create_nlb` to `false`.
30+
31+
###### If you want to enable NLB support
32+
* Leave `install_aws_load_balancer_controller` set to its default of `true`.
33+
* Set `materialize_instances[*].create_nlb` to `false`.
34+
* Run `terraform apply`.
35+
* Set `materialize_instances[*].create_nlb` to `true`.
36+
* Run `terraform apply`.
37+
38+
Due to limitations in Terraform, it cannot plan Kubernetes resources using CRDs that do not exist yet. We need to first install the AWS Load Balancer Controller in the first `terraform apply`, before defining any `TargetGroupBinding` resources which get created in the second `terraform apply`.

docs/header.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Terraform module for deploying Materialize on AWS Cloud Platform with all requir
66
77
The module has been tested with:
88
- PostgreSQL 15
9-
- Materialize Helm Operator Terraform Module v0.1.1
9+
- Materialize Helm Operator Terraform Module v0.1.8
1010

1111
## Providers Configuration
1212

examples/simple/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,8 @@ output "cluster_certificate_authority_data" {
199199
value = module.materialize_infrastructure.cluster_certificate_authority_data
200200
sensitive = true
201201
}
202+
203+
output "nlb_details" {
204+
description = "Details of the Materialize instance NLBs."
205+
value = module.materialize_infrastructure.nlb_details
206+
}

modules/nlb/outputs.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
output "nlb_dns_name" {
2+
description = "DNS name of the Network Load Balancer."
3+
value = aws_lb.nlb.dns_name
4+
}
5+
6+
output "nlb_arn" {
7+
description = "ARN of the Network Load Balancer."
8+
value = aws_lb.nlb.arn
9+
}

outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,13 @@ output "operator_details" {
8383
instances = module.operator[0].materialize_instances
8484
} : null
8585
}
86+
87+
output "nlb_details" {
88+
description = "Details of the Materialize instance NLBs."
89+
value = [
90+
for nlb in module.nlb : {
91+
arn = nlb.nlb_arn
92+
dns_name = nlb.nlb_dns_name
93+
}
94+
]
95+
}

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ variable "helm_values" {
317317
}
318318

319319
variable "materialize_instances" {
320-
description = "Configuration for Materialize instances"
320+
description = "Configuration for Materialize instances. Due to limitations in Terraform, `materialize_instances` cannot be defined on the first `terraform apply`."
321321
type = list(object({
322322
name = string
323323
namespace = optional(string)

0 commit comments

Comments
 (0)