-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Working terraform apply 2. Requires and provides integrations in outputs --------- Signed-off-by: Michael Thamm <[email protected]> Co-authored-by: Leon <[email protected]>
- Loading branch information
1 parent
d122274
commit 07a52a6
Showing
7 changed files
with
131 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
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
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,4 @@ | ||
# Terraform module for grafana-k8s | ||
|
||
|
||
This module is in experimental status. It is not yet ready for production. |
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,12 @@ | ||
resource "juju_application" "grafana" { | ||
name = var.app_name | ||
model = var.model_name | ||
trust = true | ||
charm { | ||
name = "grafana-k8s" | ||
channel = var.channel | ||
revision = var.revision | ||
} | ||
units = var.units | ||
config = var.config | ||
} |
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,24 @@ | ||
output "app_name" { | ||
value = juju_application.grafana.name | ||
} | ||
|
||
output "requires" { | ||
value = { | ||
catalogue = "catalogue", | ||
certificates = "certificates", | ||
database = "database", | ||
grafana_auth = "grafana-auth", | ||
grafana_dashboard = "grafana-dashboard", | ||
grafana_source = "grafana-source", | ||
ingress = "ingress", | ||
oauth = "oauth", | ||
receive_ca_cert = "receive-ca-cert", | ||
tracing = "tracing", | ||
} | ||
} | ||
|
||
output "provides" { | ||
value = { | ||
metrics_endpoint = "metrics-endpoint", | ||
} | ||
} |
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,42 @@ | ||
variable "app_name" { | ||
description = "Application name" | ||
type = string | ||
} | ||
|
||
variable "channel" { | ||
description = "Charm channel" | ||
type = string | ||
default = "latest/stable" | ||
} | ||
|
||
variable "config" { | ||
description = "Config options as in the ones we pass in juju config" | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
# We use constraints to set AntiAffinity in K8s | ||
# https://discourse.charmhub.io/t/pod-priority-and-affinity-in-juju-charms/4091/13?u=jose | ||
variable "constraints" { | ||
description = "Constraints to be applied" | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "model_name" { | ||
description = "Model name" | ||
type = string | ||
} | ||
|
||
variable "revision" { | ||
description = "Charm revision" | ||
type = number | ||
nullable = true | ||
default = null | ||
} | ||
|
||
variable "units" { | ||
description = "Number of units" | ||
type = number | ||
default = 1 | ||
} |
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.5" | ||
required_providers { | ||
juju = { | ||
source = "juju/juju" | ||
version = "~> 0.14" | ||
} | ||
} | ||
} |