Split base from modules

- Add infra as a example
- Introduces a dependency issue between adot operator and workload collector
This commit is contained in:
Rodrigue Koffi
2022-08-09 23:24:01 +02:00
parent 5b5d5e7dd1
commit 6dca51b135
16 changed files with 139 additions and 147 deletions
+8 -8
View File
@@ -1,7 +1,3 @@
locals {
name = "adot-collector-kubeprometheus"
namespace = try(var.config.helm_config.namespace, local.name)
}
terraform {
required_providers {
@@ -12,6 +8,11 @@ terraform {
}
}
provider "grafana" {
url = var.managed_grafana_workspace_endpoint
auth = var.grafana_api_key
}
resource "helm_release" "kube_state_metrics" {
count = var.config.enable_kube_state_metrics ? 1 : 0
chart = var.config.ksm_helm_chart_name
@@ -47,7 +48,6 @@ resource "helm_release" "prometheus_node_exporter" {
}
}
}
data "aws_partition" "current" {}
module "helm_addon" {
source = "github.com/aws-ia/terraform-aws-eks-blueprints/modules/kubernetes-addons/helm-addon"
@@ -66,11 +66,11 @@ module "helm_addon" {
set_values = [
{
name = "ampurl"
value = "${var.amp_endpoint}api/v1/remote_write"
value = "${var.managed_prometheus_workspace_endpoint}api/v1/remote_write"
},
{
name = "region"
value = var.amp_region
value = var.managed_prometheus_workspace_region
},
{
name = "prometheusMetricsEndpoint"
@@ -102,5 +102,5 @@ module "helm_addon" {
irsa_iam_policies = ["arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonPrometheusRemoteWriteAccess"]
}
addon_context = var.addon_context
addon_context = local.context
}