-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the Github workflow for the Terraform checks
Signed-off-by: gatici <[email protected]>
- Loading branch information
Showing
8 changed files
with
95 additions
and
150 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,30 @@ | ||
name: Check the Terraform Module | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**.tf' | ||
|
||
jobs: | ||
build: | ||
name: Terraform Checks and Plans | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository to the runner | ||
uses: actions/checkout@v3 | ||
|
||
- name: HashiCorp - Setup Terraform | ||
uses: hashicorp/setup-terraform@v4 | ||
|
||
- name: Terraform Format | ||
id: fmt | ||
run: terraform fmt -recursive -check | ||
continue-on-error: true | ||
|
||
- name: Terraform Init | ||
id: init | ||
run: terraform init | ||
|
||
- name: Terraform Validate | ||
id: validate | ||
run: terraform validate -no-color |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,42 +1,16 @@ | ||
resource "juju_application" "grafana-agent-k8s" { | ||
# Copyright 2024 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
|
||
resource "juju_application" "grafana" { | ||
name = "grafana-agent-k8s" | ||
model = var.model_name | ||
|
||
charm { | ||
name = "grafana-agent-k8s" | ||
channel = var.channel | ||
base = "[email protected]" | ||
} | ||
config = var.grafana-config | ||
units = 1 | ||
trust = true | ||
} | ||
|
||
resource "juju_integration" "prometheus-remote-write" { | ||
count = var.metrics_remote_write_offer_url != "" ? 1 : 0 | ||
model = var.model_name | ||
|
||
application { | ||
name = juju_application.grafana-agent-k8s.name | ||
endpoint = "send-remote-write" | ||
} | ||
|
||
application { | ||
offer_url = var.metrics_remote_write_offer_url | ||
} | ||
} | ||
|
||
resource "juju_integration" "loki-logging" { | ||
count = var.logging_offer_url != "" ? 1 : 0 | ||
model = var.model_name | ||
|
||
application { | ||
name = juju_application.grafana-agent-k8s.name | ||
endpoint = "logging-consumer" | ||
} | ||
|
||
application { | ||
offer_url = var.logging_offer_url | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -1,4 +1,52 @@ | ||
output "grafana_application_name" { | ||
# Copyright 2024 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
|
||
output "app-name" { | ||
description = "Name of the deployed application." | ||
value = juju_application.grafana-agent-k8s.name | ||
} | ||
value = juju_application.grafana.name | ||
} | ||
|
||
output "certificates-endpoint" { | ||
description = "Name of the endpoint used by Grafana to get the X.509 certificate." | ||
value = "certificates" | ||
} | ||
|
||
output "send-remote-write-endpoint" { | ||
description = "Name of the endpoint used by Grafana to forward client charms metrics and associated alert rules to Prometheus using prometheus_remote_write interface." | ||
value = "send-remote-write" | ||
} | ||
|
||
output "metrics-endpoint" { | ||
description = "Exposes the Prometheus metrics endpoint providing telemetry about the Grafana instance using prometheus_scrape interface." | ||
value = "metrics-endpoint" | ||
} | ||
|
||
output "logging-consumer-endpoint" { | ||
description = "Name of the endpoint used by Grafana to send the logs to Loki using loki_push_api interface." | ||
value = "logging-consumer" | ||
} | ||
|
||
output "grafana-dashboards-consumer-endpoint" { | ||
description = "Name of the endpoint used by Grafana to provide meaningful dashboards about it's metrics using grafana_dashboard interface." | ||
value = "grafana-dashboards-consumer" | ||
} | ||
|
||
output "grafana-cloud-config-endpoint" { | ||
description = "Name of the endpoint used by Grafana to forward telemetry to any Prometheus(or Loki) compatible endpoint using grafana_cloud_config interface." | ||
value = "grafana-cloud-config" | ||
} | ||
|
||
output "receive-ca-cert-endpoint" { | ||
description = "Name of the endpoint used by Grafana to get the Self signed X.509 Certificates through the relation with Self Signed Certificates Charm using certificate_transfer interface." | ||
value = "receive-ca-cert" | ||
} | ||
|
||
output "logging-provider-endpoint" { | ||
description = "Name of the endpoint provided by Grafana to receive logs from any charm that supports the loki_push_api relation interface." | ||
value = "logging-provider" | ||
} | ||
|
||
output "grafana-dashboards-provider-endpoint" { | ||
description = "Name of the endpoint provided by Grafana to provide meaningful dashboards about its metrics to be shown in a Grafana Charm over the grafana-dashboard relation using the grafana-dashboard interface." | ||
value = "grafana-dashboards-provider" | ||
} |
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 was deleted.
Oops, something went wrong.
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