-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
271 lines (231 loc) · 6.95 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# General Variables
variable "environment" {
description = "Environment name (e.g., prod, staging, dev)"
type = string
default = "dev"
}
variable "tags" {
description = "Default tags to apply to all resources"
type = map(string)
default = {
Environment = "dev"
Terraform = "true"
Project = "materialize"
}
}
# Networking Variables
variable "vpc_name" {
description = "Name of the VPC"
type = string
default = "materialize-vpc"
}
variable "vpc_cidr" {
description = "CIDR block for VPC"
type = string
default = "10.0.0.0/16"
}
variable "availability_zones" {
description = "List of availability zones"
type = list(string)
default = ["us-east-1a", "us-east-1b", "us-east-1c"]
}
variable "private_subnet_cidrs" {
description = "CIDR blocks for private subnets"
type = list(string)
default = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
}
variable "public_subnet_cidrs" {
description = "CIDR blocks for public subnets"
type = list(string)
default = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
}
variable "single_nat_gateway" {
description = "Use a single NAT Gateway for all private subnets"
type = bool
default = false
}
# EKS Variables
variable "cluster_name" {
description = "Name of the EKS cluster"
type = string
default = "materialize-cluster"
}
variable "cluster_version" {
description = "Kubernetes version for the EKS cluster"
type = string
default = "1.31"
}
variable "node_group_desired_size" {
description = "Desired number of worker nodes"
type = number
default = 2
}
variable "node_group_min_size" {
description = "Minimum number of worker nodes"
type = number
default = 1
}
variable "node_group_max_size" {
description = "Maximum number of worker nodes"
type = number
default = 4
}
variable "node_group_instance_types" {
description = <<EOF
Instance types for worker nodes.
Recommended Configuration for Running Materialize with disk:
- Tested instance types: `m6g`, `m7g` families (ARM-based Graviton instances)
- AMI: AWS Bottlerocket (optimized for container workloads)
- Note: Ensure instance store volumes are available and attached to the nodes for optimal performance with disk-based workloads.
EOF
type = list(string)
default = ["m6g.medium"]
}
variable "node_group_capacity_type" {
description = "Capacity type for worker nodes (ON_DEMAND or SPOT)"
type = string
default = "ON_DEMAND"
}
variable "node_group_ami_type" {
description = "AMI type for the node group"
type = string
default = "AL2023_x86_64_STANDARD"
}
variable "cluster_enabled_log_types" {
description = "List of desired control plane logging to enable"
type = list(string)
default = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
}
variable "enable_cluster_creator_admin_permissions" {
description = "To add the current caller identity as an administrator"
type = bool
default = true
}
# RDS Variables
variable "db_identifier" {
description = "Identifier for the RDS instance"
type = string
default = "materialize-db"
}
variable "postgres_version" {
description = "Version of PostgreSQL to use"
type = string
default = "15"
}
variable "db_instance_class" {
description = "Instance class for the RDS instance"
type = string
default = "db.t3.large"
}
variable "db_allocated_storage" {
description = "Allocated storage for the RDS instance (in GB)"
type = number
default = 20
}
variable "db_max_allocated_storage" {
description = "Maximum storage for autoscaling (in GB)"
type = number
default = 100
}
variable "database_name" {
description = "Name of the database to create"
type = string
default = "materialize"
}
variable "database_username" {
description = "Username for the database"
type = string
default = "materialize"
}
variable "database_password" {
description = "Password for the database (should be provided via tfvars or environment variable)"
type = string
sensitive = true
}
variable "db_multi_az" {
description = "Enable multi-AZ deployment for RDS"
type = bool
default = false
}
# S3 Variables
variable "bucket_name" {
description = "Name of the S3 bucket"
type = string
}
variable "bucket_force_destroy" {
description = "Enable force destroy for the S3 bucket"
type = bool
default = false
}
variable "enable_bucket_versioning" {
description = "Enable versioning for the S3 bucket"
type = bool
default = true
}
variable "enable_bucket_encryption" {
description = "Enable server-side encryption for the S3 bucket"
type = bool
default = true
}
variable "bucket_lifecycle_rules" {
description = "List of lifecycle rules for the S3 bucket"
type = list(object({
id = string
enabled = bool
prefix = string
transition_days = number
transition_storage_class = string
expiration_days = number
noncurrent_version_expiration_days = number
}))
default = [{
id = "cleanup"
enabled = true
prefix = ""
transition_days = 90
transition_storage_class = "STANDARD_IA"
expiration_days = 365
noncurrent_version_expiration_days = 90
}]
}
# Monitoring Variables
variable "enable_monitoring" {
description = "Enable CloudWatch monitoring"
type = bool
default = true
}
variable "metrics_retention_days" {
description = "Number of days to retain CloudWatch metrics"
type = number
default = 7
}
variable "namespace" {
description = "Namespace for Materialize resources"
type = string
default = "materialize-environment"
}
variable "service_account_name" {
description = "Name of the service account"
type = string
default = "12345678-1234-1234-1234-123456789012"
}
variable "mz_iam_service_account_name" {
description = "Name of the IAM user for Materialize service authentication (will be prefixed with environment name)"
type = string
default = "materialize-user"
}
variable "mz_iam_role_name" {
description = "Name of the IAM role for Materialize S3 access (will be prefixed with environment name)"
type = string
default = "materialize-s3-role"
}
variable "mz_iam_policy_name" {
description = "Name of the IAM policy for Materialize S3 access"
type = string
default = "materialize-s3-access"
}
variable "log_group_name_prefix" {
description = "Prefix for the CloudWatch log group name (will be combined with environment name)"
type = string
default = "materialize"
}