Skip to content

Commit ebdd9d2

Browse files
authored
Merge pull request #19 from datafold/saas-k8s-followup
fix: Adds variables to set EBS volume attributes separately.
2 parents 72f2681 + ea1aec9 commit ebdd9d2

File tree

2 files changed

+37
-9
lines changed

2 files changed

+37
-9
lines changed

main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ resource "aws_ebs_volume" "clickhouse_data" {
216216
size = var.clickhouse_data_size
217217
encrypted = true
218218
type = var.ebs_type
219-
iops = var.ebs_type != "gp2" ? var.ebs_iops : null
220-
throughput = var.ebs_type != "gp2" ? var.ebs_throughput : null
219+
iops = var.ebs_type != "gp2" ? var.ch_data_ebs_iops : null
220+
throughput = var.ebs_type != "gp2" ? var.ch_data_ebs_throughput : null
221221

222222
tags = merge({
223223
Name = "${var.deployment_name}-clickhouse-data"
@@ -229,8 +229,8 @@ resource "aws_ebs_volume" "clickhouse_logs" {
229229
size = var.clickhouse_logs_size
230230
encrypted = true
231231
type = var.ebs_type
232-
iops = var.ebs_type != "gp2" ? var.ebs_iops : null
233-
throughput = var.ebs_type != "gp2" ? var.ebs_throughput : null
232+
iops = var.ebs_type != "gp2" ? var.ch_logs_ebs_iops : null
233+
throughput = var.ebs_type != "gp2" ? var.ch_logs_ebs_throughput : null
234234

235235
tags = {
236236
Name = "${var.deployment_name}-clickhouse-logs"
@@ -242,8 +242,8 @@ resource "aws_ebs_volume" "redis_data" {
242242
size = var.redis_data_size
243243
encrypted = true
244244
type = var.ebs_type
245-
iops = var.ebs_type != "gp2" ? var.ebs_iops : null
246-
throughput = var.ebs_type != "gp2" ? var.ebs_throughput : null
245+
iops = var.ebs_type != "gp2" ? var.redis_ebs_iops : null
246+
throughput = var.ebs_type != "gp2" ? var.redis_ebs_throughput : null
247247

248248
tags = {
249249
Name = "${var.deployment_name}-redis-data"

variables.tf

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,27 +586,55 @@ variable "clickhouse_logs_size" {
586586
variable "ebs_type" {
587587
type = string
588588
default = "gp3"
589-
description = "Type of EBS volume"
589+
description = "Type for all EBS volumes"
590590
}
591591

592-
variable "ebs_iops" {
592+
variable "ch_data_ebs_iops" {
593593
type = number
594594
default = 3000
595595
description = "IOPS of EBS volume"
596596
}
597597

598-
variable "ebs_throughput" {
598+
variable "ch_data_ebs_throughput" {
599599
type = number
600600
default = 1000
601601
description = "Throughput of EBS volume"
602602
}
603603

604+
variable "ch_logs_ebs_iops" {
605+
type = number
606+
default = 3000
607+
description = "IOPS of EBS volume"
608+
}
609+
610+
variable "ch_logs_ebs_throughput" {
611+
type = number
612+
default = 250
613+
description = "Throughput of EBS volume"
614+
}
615+
604616
variable "s3_backup_bucket_name_override" {
605617
type = string
606618
default = ""
607619
description = "Bucket name override."
608620
}
609621

622+
# ┏━┓┏━╸╺┳┓╻┏━┓
623+
# ┣┳┛┣╸ ┃┃┃┗━┓
624+
# ╹┗╸┗━╸╺┻┛╹┗━┛
625+
626+
variable "redis_ebs_iops" {
627+
type = number
628+
default = 3000
629+
description = "IOPS of EBS redis volume"
630+
}
631+
632+
variable "redis_ebs_throughput" {
633+
type = number
634+
default = 125
635+
description = "Throughput of EBS redis volume"
636+
}
637+
610638
# ┏━╸╻┏ ┏━┓
611639
# ┣╸ ┣┻┓┗━┓
612640
# ┗━╸╹ ╹┗━┛

0 commit comments

Comments
 (0)