-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tf module on charm * default arch constraint
- Loading branch information
Showing
4 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
resource "juju_application" "k8s_postgresql" { | ||
name = var.app_name | ||
model = var.juju_model_name | ||
trust = true | ||
|
||
charm { | ||
name = "postgresql-k8s" | ||
channel = var.channel | ||
revision = var.revision | ||
base = var.base | ||
} | ||
|
||
storage_directives = { | ||
pgdata = var.storage_size | ||
} | ||
|
||
units = var.units | ||
constraints = var.constraints | ||
config = var.config | ||
resources = var.resources | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
output "application_name" { | ||
value = juju_application.k8s_postgresql.name | ||
} | ||
|
||
|
||
output "provides" { | ||
value = { | ||
database = "database", | ||
metrics_endpoint = "metrics-endpoint", | ||
grafana_dashboard = "grafana-dashboard" | ||
} | ||
} | ||
|
||
output "requires" { | ||
value = { | ||
logging = "logging" | ||
certificates = "certificates" | ||
s3_parameters = "s3-parameters" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
variable "juju_model_name" { | ||
description = "Juju model name" | ||
type = string | ||
} | ||
|
||
variable "app_name" { | ||
description = "Name of the application in the Juju model." | ||
type = string | ||
default = "postgresql-k8s" | ||
} | ||
|
||
variable "channel" { | ||
description = "Charm channel to use when deploying" | ||
type = string | ||
default = "14/stable" | ||
} | ||
|
||
variable "revision" { | ||
description = "Revision number to deploy charm" | ||
type = number | ||
default = null | ||
} | ||
|
||
variable "base" { | ||
description = "Application base" | ||
type = string | ||
default = "[email protected]" | ||
} | ||
|
||
variable "units" { | ||
description = "Number of units to deploy" | ||
type = number | ||
default = 1 | ||
} | ||
|
||
variable "constraints" { | ||
description = "Juju constraints to apply for this application." | ||
type = string | ||
default = "arch=amd64" | ||
} | ||
|
||
variable "storage_size" { | ||
description = "Storage size" | ||
type = string | ||
default = "10G" | ||
} | ||
|
||
variable "config" { | ||
description = "Application configuration. Details at https://charmhub.io/postgresql-k8s/configurations" | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
variable "resources" { | ||
description = "Resources to use with the application" | ||
type = map(string) | ||
default = {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_version = ">= 1.6.6" | ||
required_providers { | ||
juju = { | ||
source = "juju/juju" | ||
version = ">= 0.14.0" | ||
} | ||
} | ||
} |