Skip to content

Commit eff1031

Browse files
authored
Add conditional expose directive (#853)
1 parent 2ef8871 commit eff1031

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

terraform/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ resource "juju_application" "machine_postgresql" {
1616
units = var.units
1717
constraints = var.constraints
1818
config = var.config
19+
20+
dynamic "expose" {
21+
for_each = var.enable_expose ? [1] : []
22+
content {}
23+
}
1924
}

terraform/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,9 @@ variable "config" {
5050
type = map(string)
5151
default = {}
5252
}
53+
54+
variable "enable_expose" {
55+
type = bool
56+
default = true
57+
description = "Whether to expose the application"
58+
}

0 commit comments

Comments
 (0)