Skip to content

Commit 2b8ad38

Browse files
committed
Enable storage autoscaling. Default value is 100GB
1 parent 022a515 commit 2b8ad38

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

main.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ resource "cloudfoundry_service_instance" "postgres" {
1111
space = var.cf_space_id
1212
//noinspection HILUnresolvedReference
1313
service_plan = data.cloudfoundry_service.rds.service_plans[var.plan]
14-
replace_on_service_plan_change = true
14+
replace_on_service_plan_change = var.replace_on_service_plan_change
15+
16+
json_params = jsonencode({
17+
"MaxAllocatedStorage" : var.max_allocated_storage
18+
})
1519
}
1620

1721
resource "cloudfoundry_service_key" "database_key" {
@@ -43,7 +47,7 @@ resource "cloudfoundry_app" "exporter" {
4347
}
4448
annotations = {
4549
"prometheus.exporter.type" = "pg_exporter"
46-
"prometheus.exporter.port" = "9187"
50+
"prometheus.exporter.port" = "3100"
4751
"prometheus.exporter.path" = "/metrics"
4852
}
4953
}

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,15 @@ variable "exporter_environment" {
5050
description = "Additional configuration for the exporter"
5151
default = {}
5252
}
53+
54+
variable "replace_on_service_plan_change" {
55+
type = bool
56+
description = "Replaces the instance in case of service plan change. Does not preserve data!"
57+
default = false
58+
}
59+
60+
variable "max_allocated_storage" {
61+
type = number
62+
description = "Sets the maximum storage size (in GB). Enables autoscaling"
63+
default = 100
64+
}

0 commit comments

Comments
 (0)