Skip to content

Commit

Permalink
Fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bonclay7 committed Jan 16, 2024
1 parent 1d39e8c commit 3e00868
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/eks-cross-account-with-central-amp/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ data "aws_eks_cluster" "eks_two" {
}

data "aws_grafana_workspace" "this" {
workspace_id = var.managed_grafana_workspace_id
workspace_id = var.monitoring.managed_grafana_id
provider = aws.eks_cluster_one
}
2 changes: 1 addition & 1 deletion examples/eks-multicluster/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ data "aws_grafana_workspace" "this" {
}

data "aws_prometheus_workspace" "this" {
workspace_id = var.managed_prometheus_workspace_id
workspace_id = local.managed_prometheus_workspace_id
provider = aws.eks_cluster_1
}
17 changes: 16 additions & 1 deletion examples/eks-multicluster/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
locals {
create_new_workspace = var.managed_prometheus_workspace_id == "" ? true : false
managed_prometheus_workspace_id = local.create_new_workspace ? module.managed_service_prometheus[0].workspace_id : var.managed_prometheus_workspace_id
}
module "eks_cluster_1_monitoring" {
source = "../..//modules/eks-monitoring"
eks_cluster_id = var.eks_cluster_1_id
Expand All @@ -23,7 +27,7 @@ module "eks_cluster_1_monitoring" {
# prevents the module to create a workspace
enable_managed_prometheus = false

managed_prometheus_workspace_id = var.managed_prometheus_workspace_id
managed_prometheus_workspace_id = local.managed_prometheus_workspace_id
managed_prometheus_workspace_endpoint = data.aws_prometheus_workspace.this.prometheus_endpoint
managed_prometheus_workspace_region = var.eks_cluster_1_region

Expand Down Expand Up @@ -78,3 +82,14 @@ module "eks_cluster_2_monitoring" {
helm = helm.eks_cluster_2
}
}

module "managed_service_prometheus" {
count = local.create_new_workspace ? 1 : 0
source = "terraform-aws-modules/managed-service-prometheus/aws"
version = "~> 2.2.2"
providers = {
aws = aws.eks_cluster_1
}

workspace_alias = "aws-observability-accelerator-multicluster"
}

0 comments on commit 3e00868

Please sign in to comment.