Skip to content

Commit

Permalink
Enable storage autoscaling. Default value is 100GB
Browse files Browse the repository at this point in the history
  • Loading branch information
loafoe committed May 27, 2022
1 parent 022a515 commit 2b8ad38
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ resource "cloudfoundry_service_instance" "postgres" {
space = var.cf_space_id
//noinspection HILUnresolvedReference
service_plan = data.cloudfoundry_service.rds.service_plans[var.plan]
replace_on_service_plan_change = true
replace_on_service_plan_change = var.replace_on_service_plan_change

json_params = jsonencode({
"MaxAllocatedStorage" : var.max_allocated_storage
})
}

resource "cloudfoundry_service_key" "database_key" {
Expand Down Expand Up @@ -43,7 +47,7 @@ resource "cloudfoundry_app" "exporter" {
}
annotations = {
"prometheus.exporter.type" = "pg_exporter"
"prometheus.exporter.port" = "9187"
"prometheus.exporter.port" = "3100"
"prometheus.exporter.path" = "/metrics"
}
}
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,15 @@ variable "exporter_environment" {
description = "Additional configuration for the exporter"
default = {}
}

variable "replace_on_service_plan_change" {
type = bool
description = "Replaces the instance in case of service plan change. Does not preserve data!"
default = false
}

variable "max_allocated_storage" {
type = number
description = "Sets the maximum storage size (in GB). Enables autoscaling"
default = 100
}

0 comments on commit 2b8ad38

Please sign in to comment.