Skip to content

Commit

Permalink
Update outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
bonclay7 committed Jan 15, 2024
1 parent 7a2f6ad commit b34e4a9
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 34 deletions.
8 changes: 4 additions & 4 deletions examples/eks-istio/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
output "aws_region" {
output "managed_prometheus_workspace_region" {
description = "AWS Region"
value = module.aws_observability_accelerator.aws_region
value = module.eks_monitoring.managed_prometheus_workspace_region
}

output "managed_prometheus_workspace_endpoint" {
description = "Amazon Managed Prometheus workspace endpoint"
value = module.aws_observability_accelerator.managed_prometheus_workspace_endpoint
value = module.eks_monitoring.managed_prometheus_workspace_endpoint
}

output "managed_prometheus_workspace_id" {
description = "Amazon Managed Prometheus workspace ID"
value = module.aws_observability_accelerator.managed_prometheus_workspace_id
value = module.eks_monitoring.managed_prometheus_workspace_id
}

output "eks_cluster_version" {
Expand Down
4 changes: 0 additions & 4 deletions examples/existing-cluster-java/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,4 @@ module "eks_monitoring" {
enable_logs = true

tags = local.tags

depends_on = [
module.aws_observability_accelerator
]
}
8 changes: 4 additions & 4 deletions examples/existing-cluster-java/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
output "aws_region" {
output "managed_prometheus_workspace_region" {
description = "AWS Region"
value = module.aws_observability_accelerator.aws_region
value = module.eks_monitoring.managed_prometheus_workspace_region
}

output "managed_prometheus_workspace_endpoint" {
description = "Amazon Managed Prometheus workspace endpoint"
value = module.aws_observability_accelerator.managed_prometheus_workspace_endpoint
value = module.eks_monitoring.managed_prometheus_workspace_endpoint
}

output "managed_prometheus_workspace_id" {
description = "Amazon Managed Prometheus workspace ID"
value = module.aws_observability_accelerator.managed_prometheus_workspace_id
value = module.eks_monitoring.managed_prometheus_workspace_id
}

output "eks_cluster_version" {
Expand Down
18 changes: 0 additions & 18 deletions examples/existing-cluster-nginx/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,6 @@ locals {
}
}

module "aws_observability_accelerator" {
source = "../../"
# source = "github.com/aws-observability/terraform-aws-observability-accelerator?ref=v2.0.0"

aws_region = var.aws_region

# creates a new AMP workspace, defaults to true
enable_managed_prometheus = local.create_new_workspace

# reusing existing AMP if specified
managed_prometheus_workspace_id = var.managed_prometheus_workspace_id

# reusing existing Amazon Managed Grafana workspace
managed_grafana_workspace_id = var.managed_grafana_workspace_id

tags = local.tags
}

module "eks_monitoring" {
source = "../../modules/eks-monitoring"
# source = "github.com/aws-observability/terraform-aws-observability-accelerator//modules/eks-monitoring?ref=v2.0.0"
Expand Down
8 changes: 4 additions & 4 deletions examples/existing-cluster-nginx/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
output "aws_region" {
output "managed_prometheus_workspace_region" {
description = "AWS Region"
value = module.aws_observability_accelerator.aws_region
value = module.eks_monitoring.managed_prometheus_workspace_region
}

output "managed_prometheus_workspace_endpoint" {
description = "Amazon Managed Prometheus workspace endpoint"
value = module.aws_observability_accelerator.managed_prometheus_workspace_endpoint
value = module.eks_monitoring.managed_prometheus_workspace_endpoint
}

output "managed_prometheus_workspace_id" {
description = "Amazon Managed Prometheus workspace ID"
value = module.aws_observability_accelerator.managed_prometheus_workspace_id
value = module.eks_monitoring.managed_prometheus_workspace_id
}

output "eks_cluster_version" {
Expand Down
15 changes: 15 additions & 0 deletions examples/existing-cluster-with-base-and-infra/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
output "managed_prometheus_workspace_region" {
description = "AWS Region"
value = module.eks_monitoring.managed_prometheus_workspace_region
}

output "managed_prometheus_workspace_endpoint" {
description = "Amazon Managed Prometheus workspace endpoint"
value = module.eks_monitoring.managed_prometheus_workspace_endpoint
}

output "managed_prometheus_workspace_id" {
description = "Amazon Managed Prometheus workspace ID"
value = module.eks_monitoring.managed_prometheus_workspace_id
}

output "eks_cluster_version" {
description = "EKS Cluster version"
value = module.eks_monitoring.eks_cluster_version
Expand Down
1 change: 1 addition & 0 deletions modules/eks-monitoring/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data "aws_eks_cluster" "eks_cluster" {
name = var.eks_cluster_id
}


locals {
# if region is not passed, we assume the current one
managed_prometheus_workspace_id = var.enable_managed_prometheus ? aws_prometheus_workspace.this[0].id : var.managed_prometheus_workspace_id
Expand Down
15 changes: 15 additions & 0 deletions modules/eks-monitoring/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,18 @@ output "adot_irsa_arn" {
description = "IRSA Arn for ADOT"
value = module.helm_addon.irsa_arn
}

output "managed_prometheus_workspace_endpoint" {
description = "Amazon Managed Prometheus workspace endpoint"
value = local.managed_prometheus_workspace_endpoint
}

output "managed_prometheus_workspace_id" {
description = "Amazon Managed Prometheus workspace ID"
value = local.managed_prometheus_workspace_id
}

output "managed_prometheus_workspace_region" {
description = "Amazon Managed Prometheus workspace region"
value = local.managed_prometheus_workspace_region
}

0 comments on commit b34e4a9

Please sign in to comment.