Files
terraform-aws-observability…/examples/managed-prometheus-monitoring/main.tf
T
Kevin Lewin 07545aca27 AMP Observability Pattern (#55)
* working first run

* removing core module dependencies

* adding CW datasource

* alarms MVP

* readmes

* Adding Screenshot

* Adding billing note

* adding billing module

* Revert "adding billing module"

This reverts commit 40d667e37db1036cd71a471ef2fde83ec02aaa13.

reverting

* adding billing module

* Updating Screenshot

* resolving feedback

* removing unused modules

* fmt

* Support for tf 1.3.x

* removing unused variables

* support alarms for multiple workspaces

* Updating Readme

* amp to managed prometheus

* sub-module

* Fix pre-commit

Co-authored-by: Rodrigue Koffi <bonclay7@users.noreply.github.com>
2022-12-09 10:49:55 -05:00

30 lines
834 B
Terraform

provider "aws" {
region = local.region
}
provider "grafana" {
url = local.amg_ws_endpoint
auth = var.grafana_api_key
}
data "aws_grafana_workspace" "this" {
count = var.managed_grafana_workspace_id == "" ? 0 : 1
workspace_id = var.managed_grafana_workspace_id
}
locals {
region = var.aws_region
amg_ws_endpoint = "https://${data.aws_grafana_workspace.this[0].endpoint}"
}
resource "grafana_folder" "this" {
title = "Amazon Managed Prometheus monitoring dashboards"
}
module "managed_prometheus_monitoring" {
source = "../../modules/workloads/managed-prometheus-monitoring"
dashboards_folder_id = resource.grafana_folder.this.id
aws_region = local.region
managed_prometheus_workspace_ids = var.managed_prometheus_workspace_ids
}