Skip to content

Commit 30bcba4

Browse files
committed
feat(postgres): Allow storage_type selection for RDS
1 parent 85e2e3d commit 30bcba4

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

modules/postgres/rds/0.2/facets.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ spec:
150150
minimum: 0
151151
required:
152152
- instance
153+
storage_type:
154+
type: string
155+
title: Storage Type
156+
description: EBS volume type for database storage
157+
default: "gp3"
158+
enum:
159+
- "gp2"
160+
- "gp3"
153161
db_names:
154162
type: array
155163
title: Database Names

modules/postgres/rds/0.2/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ locals {
2424
tags = merge(local.user_defined_tags, var.environment.cloud_tags)
2525
iops = local.storage_type == "gp2" ? null : local.storage_type == "gp3" && local.allocated_storage < 400 ? null : lookup(local.advanced_rds_postgres, "iops", 12000) < 12000 ? 12000 : lookup(local.advanced_rds_postgres, "iops", 12000)
2626
allocated_storage = lookup(local.advanced_rds_postgres, "allocated_storage", 50)
27-
storage_type = lookup(local.advanced_rds_postgres, "storage_type", "gp3")
27+
storage_type = lookup(var.instance.spec, "storage_type", lookup(local.advanced_rds_postgres, "storage_type", "gp3"))
2828
max_allocated_storage = lookup(local.advanced_rds_postgres, "max_allocated_storage", 200)
2929
multi_az = lookup(local.advanced_rds_postgres, "multi_az", false)
3030
availability_zone = local.multi_az ? null : lookup(local.advanced_rds_postgres, "availability_zone", null) == null ? var.inputs.network_details.attributes.legacy_outputs.vpc_details.azs[0] : lookup(local.advanced_rds_postgres, "availability_zone", null)

0 commit comments

Comments
 (0)