-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
43 lines (36 loc) · 1.03 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
# Giving priority to Managed Prometheus datasources
is_default = false
json_data_encoded = jsonencode({
default_region = var.aws_region
sigv4_auth = true
sigv4_auth_type = "workspace-iam-role"
sigv4_region = var.aws_region
})
}
data "http" "dashboard" {
url = "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/a72787328e493c4628680487e3c885fc395d1c56/artifacts/grafana-dashboards/amp/amp-dashboard.json"
request_headers = {
Accept = "application/json"
}
}
resource "grafana_dashboard" "this" {
folder = var.dashboards_folder_id
config_json = data.http.dashboard.response_body
}
module "billing" {
source = "./billing"
providers = {
aws = aws.billing_region
}
}