diff --git a/terraform/main.tf b/terraform/main.tf index e55420a960..e38c14628a 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -16,4 +16,9 @@ resource "juju_application" "machine_postgresql" { units = var.units constraints = var.constraints config = var.config + + dynamic "expose" { + for_each = var.enable_expose ? [1] : [] + content {} + } } diff --git a/terraform/variables.tf b/terraform/variables.tf index ede475f37a..987bb16ba0 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -50,3 +50,9 @@ variable "config" { type = map(string) default = {} } + +variable "enable_expose" { + type = bool + default = true + description = "Whether to expose the application" +}