Skip to content

Commit f51392a

Browse files
committed
Fix missing vars
1 parent d2998af commit f51392a

File tree

12 files changed

+93
-49
lines changed

12 files changed

+93
-49
lines changed

.terraform.lock.hcl

Lines changed: 0 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ No resources.
4545
| Name | Description | Type | Default | Required |
4646
|------|-------------|------|---------|:--------:|
4747
| <a name="input_database_config"></a> [database\_config](#input\_database\_config) | Cloud SQL configuration | <pre>object({<br/> tier = string<br/> version = string<br/> password = string<br/> })</pre> | <pre>{<br/> "password": null,<br/> "tier": "db-custom-2-4096",<br/> "version": "POSTGRES_15"<br/>}</pre> | no |
48-
| <a name="input_gke_config"></a> [gke\_config](#input\_gke\_config) | GKE cluster configuration | <pre>object({<br/> node_count = number<br/> machine_type = string<br/> disk_size_gb = number<br/> min_nodes = number<br/> max_nodes = number<br/> })</pre> | <pre>{<br/> "disk_size_gb": 100,<br/> "machine_type": "e2-standard-4",<br/> "max_nodes": 5,<br/> "min_nodes": 1,<br/> "node_count": 3<br/>}</pre> | no |
48+
| <a name="input_gke_config"></a> [gke\_config](#input\_gke\_config) | GKE cluster configuration | <pre>object({<br/> node_count = number<br/> machine_type = string<br/> disk_size_gb = number<br/> min_nodes = number<br/> max_nodes = number<br/> node_locations = list(string)<br/> })</pre> | <pre>{<br/> "disk_size_gb": 100,<br/> "machine_type": "e2-standard-4",<br/> "max_nodes": 5,<br/> "min_nodes": 1,<br/> "node_count": 3,<br/> "node_locations": []<br/>}</pre> | no |
4949
| <a name="input_labels"></a> [labels](#input\_labels) | Labels to apply to all resources | `map(string)` | `{}` | no |
5050
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Kubernetes namespace for Materialize | `string` | `"materialize"` | no |
5151
| <a name="input_network_config"></a> [network\_config](#input\_network\_config) | Network configuration for the GKE cluster | <pre>object({<br/> subnet_cidr = string<br/> pods_cidr = string<br/> services_cidr = string<br/> })</pre> | <pre>{<br/> "pods_cidr": "10.48.0.0/14",<br/> "services_cidr": "10.52.0.0/20",<br/> "subnet_cidr": "10.0.0.0/20"<br/>}</pre> | no |

examples/complete/main.tf

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module "materialize" {
88

99
project_id = var.project_id
1010
region = var.region
11-
prefix = "mz-prod"
11+
prefix = "mz-${var.environment}"
1212

1313
network_config = {
1414
subnet_cidr = "10.0.0.0/20"
@@ -17,11 +17,12 @@ module "materialize" {
1717
}
1818

1919
gke_config = {
20-
node_count = 5
21-
machine_type = "e2-standard-8"
22-
disk_size_gb = 200
23-
min_nodes = 3
24-
max_nodes = 7
20+
node_count = 5
21+
machine_type = "e2-standard-8"
22+
disk_size_gb = 200
23+
min_nodes = 3
24+
max_nodes = 7
25+
node_locations = var.node_locations
2526
}
2627

2728
database_config = {
@@ -30,9 +31,11 @@ module "materialize" {
3031
password = var.database_password
3132
}
3233

34+
maintenance_window = var.maintenance_window
35+
3336
labels = {
34-
environment = "production"
37+
environment = var.environment
38+
team = var.team
3539
managed_by = "terraform"
36-
team = "data-platform"
3740
}
3841
}

examples/complete/providers.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.0"
3+
4+
required_providers {
5+
google = {
6+
source = "hashicorp/google"
7+
version = ">= 6.0"
8+
}
9+
}
10+
}

examples/simple/providers.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.0"
3+
4+
required_providers {
5+
google = {
6+
source = "hashicorp/google"
7+
version = ">= 6.0"
8+
}
9+
}
10+
}

modules/database/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ resource "google_sql_database_instance" "materialize" {
2121
}
2222

2323
maintenance_window {
24-
day = 7 # Sunday
25-
hour = 3 # 3 AM
24+
day = 7
25+
hour = 3
2626
update_track = "stable"
2727
}
28+
29+
user_labels = var.labels
2830
}
2931

3032
deletion_protection = true

modules/database/providers.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.0"
3+
4+
required_providers {
5+
google = {
6+
source = "hashicorp/google"
7+
version = ">= 6.0"
8+
}
9+
}
10+
}

modules/gke/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ resource "google_service_account" "workload_identity_sa" {
3737
}
3838

3939
resource "google_container_cluster" "primary" {
40-
provider = google-beta
40+
provider = google
4141

4242
name = "${var.prefix}-gke"
4343
location = var.region
@@ -77,7 +77,7 @@ resource "google_container_cluster" "primary" {
7777
}
7878

7979
resource "google_container_node_pool" "primary_nodes" {
80-
provider = google-beta
80+
provider = google
8181

8282
name = "${var.prefix}-node-pool"
8383
location = var.region

modules/gke/providers.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.0"
3+
4+
required_providers {
5+
google = {
6+
source = "hashicorp/google"
7+
version = ">= 6.0"
8+
}
9+
}
10+
}

modules/storage/main.tf

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ resource "google_storage_bucket" "materialize" {
1010
enabled = true
1111
}
1212

13-
lifecycle_rule {
14-
condition {
15-
age = 30
16-
}
17-
action {
18-
type = "SetStorageClass"
19-
storage_class = "NEARLINE"
13+
dynamic "lifecycle_rule" {
14+
for_each = var.lifecycle_rules
15+
content {
16+
action {
17+
type = lifecycle_rule.value.action.type
18+
storage_class = lifecycle_rule.value.action.storage_class
19+
}
20+
condition {
21+
age = lifecycle_rule.value.condition.age
22+
created_before = lifecycle_rule.value.condition.created_before
23+
with_state = lifecycle_rule.value.condition.with_state
24+
num_newer_versions = lifecycle_rule.value.condition.num_newer_versions
25+
}
2026
}
2127
}
2228

0 commit comments

Comments
 (0)