Skip to content

Commit 9437a97

Browse files
committed
Support implicit new AMP creation
1 parent 422a291 commit 9437a97

File tree

1 file changed

+5
-3
lines changed
  • examples/existing-cluster-with-base-and-infra

1 file changed

+5
-3
lines changed

examples/existing-cluster-with-base-and-infra/main.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ terraform {
2828
required_providers {
2929
grafana = {
3030
source = "grafana/grafana"
31-
version = "1.25.0"
31+
version = ">= 1.25.0"
3232
}
3333
}
3434
}
@@ -41,6 +41,8 @@ locals {
4141
eks_cluster_endpoint = data.aws_eks_cluster.this.endpoint
4242
eks_cluster_version = data.aws_eks_cluster.this.version
4343

44+
create_new_workspace = var.managed_prometheus_workspace_id == "" ? true : false
45+
4446
tags = {
4547
Source = "github.com/aws-observability/terraform-aws-observability-accelerator"
4648
}
@@ -61,9 +63,9 @@ module "eks_observability_accelerator" {
6163
enable_cert_manager = true
6264

6365
# creates a new AMP workspace, defaults to true
64-
enable_managed_prometheus = false
66+
enable_managed_prometheus = local.create_new_workspace
6567

66-
# reusing existing AMP -- needs data source for alerting rules
68+
# reusing existing AMP if specified
6769
managed_prometheus_workspace_id = var.managed_prometheus_workspace_id
6870
managed_prometheus_workspace_region = null # defaults to the current region, useful for cross region scenarios (same account)
6971

0 commit comments

Comments
 (0)