Files
terraform-aws-observability…/modules/workloads/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

34 lines
781 B
Terraform

provider "aws" {
region = "us-east-1"
alias = "billing_region"
}
locals {
name = "aws-observability-accelerator-cloudwatch"
amp_list = toset(split(",", var.managed_prometheus_workspace_ids))
}
resource "grafana_data_source" "cloudwatch" {
type = "cloudwatch"
name = local.name
is_default = true
json_data {
default_region = var.aws_region
sigv4_auth = true
sigv4_auth_type = "workspace-iam-role"
sigv4_region = var.aws_region
}
}
resource "grafana_dashboard" "this" {
folder = var.dashboards_folder_id
config_json = file("${path.module}/dashboards/amp-dashboard.json")
}
module "billing" {
source = "../../workloads/managed-prometheus-monitoring/billing"
providers = {
aws = aws.billing_region
}
}