mirror of
https://github.com/storytold/terraform-aws-observability-accelerator.git
synced 2026-10-09 00:09:43 +00:00
caeebe0e1a
* Made the cluster variable visible in dashboards * Made the repo reusable with multiple EKS clusters * Relabled the input variable from create_grafana_data_source to create_prometheus_data_source
46 lines
998 B
Terraform
46 lines
998 B
Terraform
resource "aws_prometheus_workspace" "this" {
|
|
count = var.enable_managed_prometheus ? 1 : 0
|
|
|
|
alias = local.name
|
|
tags = var.tags
|
|
}
|
|
|
|
resource "aws_prometheus_alert_manager_definition" "this" {
|
|
count = var.enable_alertmanager ? 1 : 0
|
|
|
|
workspace_id = local.amp_ws_id
|
|
|
|
definition = <<EOF
|
|
alertmanager_config: |
|
|
route:
|
|
receiver: 'default'
|
|
receivers:
|
|
- name: 'default'
|
|
EOF
|
|
}
|
|
|
|
provider "grafana" {
|
|
url = local.amg_ws_endpoint
|
|
auth = var.grafana_api_key
|
|
}
|
|
|
|
resource "grafana_data_source" "amp" {
|
|
count = var.create_prometheus_data_source ? 1 : 0
|
|
type = "prometheus"
|
|
name = local.name
|
|
is_default = true
|
|
url = local.amp_ws_endpoint
|
|
json_data {
|
|
http_method = "GET"
|
|
sigv4_auth = true
|
|
sigv4_auth_type = "workspace-iam-role"
|
|
sigv4_region = local.amp_ws_region
|
|
}
|
|
}
|
|
|
|
# dashboards
|
|
resource "grafana_folder" "this" {
|
|
count = var.create_dashboard_folder ? 1 : 0
|
|
title = "Observability Accelerator Dashboards"
|
|
}
|