diff --git a/terraform/main.tf b/terraform/main.tf index c79d6a9c96..e492f971a9 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -1,6 +1,5 @@ resource "juju_application" "k8s_postgresql" { name = var.app_name - model = var.juju_model_name trust = true charm { @@ -10,12 +9,11 @@ resource "juju_application" "k8s_postgresql" { base = var.base } - storage_directives = { - pgdata = var.storage_size - } + storage_directives = var.storage_directives units = var.units constraints = var.constraints config = var.config resources = var.resources + model_uuid = var.juju_model } diff --git a/terraform/variables.tf b/terraform/variables.tf index 5a841c32b5..9a0bf81ade 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,5 +1,5 @@ -variable "juju_model_name" { - description = "Juju model name" +variable "juju_model" { + description = "Juju model uuid" type = string } @@ -39,10 +39,12 @@ variable "constraints" { default = "arch=amd64" } -variable "storage_size" { - description = "Storage size" - type = string - default = "10G" +variable "storage_directives" { + description = "Storage directives to apply for this application" + type = map(string) + default = { + data = "10G" + } } variable "config" { diff --git a/terraform/versions.tf b/terraform/versions.tf index 3586261576..2c9f99d018 100644 --- a/terraform/versions.tf +++ b/terraform/versions.tf @@ -3,7 +3,7 @@ terraform { required_providers { juju = { source = "juju/juju" - version = ">= 0.14.0" + version = "~> 1.0.0" } } }